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
52
votes
12 answers

How to click an element in Selenium WebDriver using JavaScript?

I have the following HTML: My following code for clicking "Google Search" button is working well using Java in…
Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
49
votes
5 answers

What the difference between .click and .change on a checkbox

I was looking around to add an event to a checkbox and I would have thought people would use .change to set up a change event but instead I found that people are using .click Is there a reason for this? They both seem to work fine both with clicked…
qwertymk
  • 34,200
  • 28
  • 121
  • 184
49
votes
4 answers

Javascript Click on Element by Class

So I am writing a script that can be run on a page but I want to click on this element, unfortunately, it does not have an id to get and I am trying to use the .click() function on it, but it doesn't work, here's what I have, anyone know how to fix…
Cup of Java
  • 1,769
  • 2
  • 21
  • 34
45
votes
24 answers

Android - ListView - performItemClick

I'm facing some difficults when I try to use the performItemClick funcion of the ListView. All I want to do is to perform a click programatically in the first item of the list. How can I do that? I looked up that function in the documentation, but I…
user1022011
45
votes
8 answers

Combine hover and click functions (jQuery)?

Can hover and click functions be combined into one, so for example: click: $('#target').click(function() { // common operation }); hover: $('#target').hover(function () { // common operation }); can they be combined into one function?…
eozzy
  • 66,048
  • 104
  • 272
  • 428
45
votes
9 answers

how to make div click-able?

shanghaimale
For div like above,when mouse on,it should become cursor:pointer,and when clicked,fire a javascript function,how to do that job? EDIT: and how to change the background color of div when mouse is…
omg
  • 136,412
  • 142
  • 288
  • 348
44
votes
15 answers

jQuery click off element event

I have a floating div that gets displayed, and I want it to be hidden when the user clicks off the div. This would be similar to the .hover() function callback when hovering off an element. Only I want to do this for click. I tried just setting a…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
43
votes
6 answers

Detect click on HTML button through javascript in Android WebView

I'm not highly familiar with javascript but I think this is the best way to accomplish my purpose. If not, please correct me. I have a licence text 2 buttons at the end. All of this is written in HTML in a WebView because there are some links in…
Sephy
  • 50,022
  • 30
  • 123
  • 131
42
votes
16 answers

Cancel click event in the mouseup event handler

Writing some drag&drop code, I'd like to cancel the click events in my mouseup handler. I figured preventing default should do the trick, but the click event is still fired. Is there a way to do this? This doesn't work:
Yaron
  • 2,053
  • 2
  • 19
  • 21
42
votes
6 answers

Android make phone numbers clickable, autodetect

When I am using android on websites and reading emails, I notice that I can click on addresses to load into google maps, or click on phone numbers to call, or click on emails and send an email. These elements on the web are formatted in a variety of…
CQM
  • 42,592
  • 75
  • 224
  • 366
42
votes
12 answers

Why/when do I have to tap twice to trigger click on iOS

Ok I feel like I'm crazy... I'm looking at Mobile Safari on iOs 6.0. I can't seem to establish any rhyme or reason as to when tapping on an element will trigger click. In many cases, it seems I need to tap once to trigger a hover and then again to…
user2383672
  • 449
  • 1
  • 5
  • 6
41
votes
2 answers

Triggering a JavaScript click() event at specific coordinates

Trying to fire off (trigger) a click event. Its easy to do in jQuery, but cannot figure out how to set the coordinates of the event and send them along. Essentially, I need to trigger a click at a specific location (which is calculated prior to the…
OneNerd
  • 6,442
  • 17
  • 60
  • 78
40
votes
5 answers

How do I clear the dropdownlist values on button click event using jQuery?

How do I clear the dropdownlist values on button click event using jQuery?
kumar
  • 2,944
  • 18
  • 60
  • 89