Questions tagged [click]

In user interfaces, click refers to the depressing of a mouse button or similar input device.

In user interfaces, click refers to the depressing of a mouse button or similar input device. Most user interface languages provide the facility to track click . Such an event is usually dispatched after the user has pressed, then released the mouse button.

9400 questions
136
votes
5 answers

How to remove all click event handlers using jQuery?

I'm having a problem. Basically, when a user clicks an 'Edit' link on a page, the following Jquery code runs: $("#saveBtn").click(function () { saveQuestion(id); }); By doing this, the onClick event of the save button calls the saveQuestion()…
Ali
  • 261,656
  • 265
  • 575
  • 769
131
votes
9 answers

Why is this jQuery click function not working?

Code: The…
starbucks
  • 2,926
  • 9
  • 41
  • 53
124
votes
9 answers

open a url on click of ok button in android

I have to open a URL on Click of OK Button in a view. Can someone tell how to do this?
Tushar
  • 5,907
  • 15
  • 49
  • 81
119
votes
6 answers

Get clicked element using jQuery on event?

I'm using the following code to detect when a dynamically generated button is clicked. $(document).on("click",".appDetails", function () { alert("test"); }); Normally, if you just did $('.appDetails').click() you could use $(this) to get the…
user736893
118
votes
5 answers

How can I check if a key is pressed during the click event with jQuery?

I would like to catch a click event with jQuery and be able to tell if a key was pressed at the same time so I can fork within the callback function based on the keypress event. For example: $("button").click(function() { if([KEYPRESSED WHILE…
daniel smith
  • 1,181
  • 2
  • 7
  • 3
117
votes
3 answers

Can I click a button programmatically for a predefined intent?

I need the button click of the intent ACTION_SEND. Here there is no need of displaying UI. Can I get the "Send" button click from the MMS-SMSProvider in Android?
info
  • 2,152
  • 5
  • 22
  • 38
115
votes
5 answers

Is there an equivalent to e.PageX position for 'touchstart' event as there is for click event?

I'm trying to get the X position with jQuery of a touchstart event, used with the live function? I.e. $('#box').live('touchstart', function(e) { var xPos = e.PageX; } ); Now, this does work with 'click' as the event. How on earth (without using the…
waxical
  • 3,826
  • 8
  • 45
  • 69
110
votes
8 answers

$(document).click() not working correctly on iPhone. jquery

This function works perfectly on IE, Firefox and Chrome but when on the iPhone, it will only work when clicking on a . Clicking on the page (anywhere but on a img) wont fire the event. $(document).ready(function () { …
Garrows
  • 3,031
  • 3
  • 25
  • 21
100
votes
7 answers

$(document).on("click"... not working?

Is there a well-known mistake I could be making here? I've got a script that's using .on() because an element is dynamically generated, and it isn't working. Just to test it out, I replaced the selector with the dynamic element's wrap, which is…
Mr. Lavalamp
  • 1,860
  • 4
  • 17
  • 29
97
votes
6 answers

jQuery click anywhere in the page except on 1 div

How can I trigger a function when I click anywhere on my page except on one div (id=menu_content) ?
Vincent Roye
  • 2,751
  • 7
  • 33
  • 53
96
votes
6 answers

How to stop default link click behavior with jQuery

I have a link on a web page. When a user clicks it, a widget on the page should update. However, I am doing something, because the default functionality (navigating to a different page) occurs before the event fires. This is what the link looks…
smartcaveman
  • 41,281
  • 29
  • 127
  • 212
96
votes
13 answers

jQuery, checkboxes and .is(":checked")

When I bind a function to a checkbox element like: $("#myCheckbox").click( function() { alert($(this).is(":checked")); }); The checkbox changes its checked attribute before the event is triggered, this is the normal behavior, and gives an…
Ben
  • 16,275
  • 9
  • 45
  • 63
94
votes
6 answers

How to trigger click event on href element

I'm trying to trigger click event on hyperlink with jQuery like the way below. Hyperlink does not have any id but it does have css class: $(document).ready(function () { $('.cssbuttongo').trigger('click'); }); The function above is not…
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
92
votes
8 answers

Simulate a click on 'a' element using javascript/jquery

I am trying to simulate a click on on an element. HTML for the same is as follows
user2373137
  • 956
  • 1
  • 8
  • 10
87
votes
19 answers

jQuery Button.click() event is triggered twice

I have the following problem with this code: $("#delete").button({ icons: { primary: 'ui-icon-trash' } }).click(function() { alert("Clicked"); }); If I click this button, the…
user276289
  • 1,519
  • 2
  • 12
  • 14