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
2911
votes
91 answers

How do I detect a click outside an element?

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area. Is something like this possible with…
Sergio del Amo
  • 76,835
  • 68
  • 152
  • 179
2026
votes
17 answers

Click through div to underlying elements

I have a div that has background:transparent, along with border. Underneath this div, I have more elements. Currently, I'm able to click the underlying elements when I click outside of the overlay div. However, I'm unable to click the underlying…
Ryan
  • 21,437
  • 7
  • 25
  • 28
1180
votes
12 answers

How to create a checkbox with a clickable label?

How can I create an HTML checkbox with a label that is clickable (this means that clicking on the label turns the checkbox on/off)?
laurent
  • 88,262
  • 77
  • 290
  • 428
590
votes
13 answers

Difference between .on('click') vs .click()

Is there any difference between the following code? $('#whatever').on('click', function() { /* your code here */ }); and $('#whatever').click(function() { /* your code here */ });
Ben G
  • 26,091
  • 34
  • 103
  • 170
348
votes
29 answers

jQuery click events firing multiple times

I'm attempting to write a video poker game in Javascript as a way of getting the basics of it down, and I've run into a problem where the jQuery click event handlers are firing multiple times. They're attached to buttons for placing a bet, and it…
Gregory Fowler
  • 3,623
  • 2
  • 13
  • 7
306
votes
12 answers

How to trigger a click on a link using jQuery

I have a link: and I am trying to trigger it by using: $(document).ready(function() { $('#titleee').find('a').trigger('click'); }); But it…
Patrioticcow
  • 26,422
  • 75
  • 217
  • 337
216
votes
37 answers

How to bind 'touchstart' and 'click' events but not respond to both?

I'm working on a mobile web site that has to work on a variety of devices. The ones giving me a headache at the moment are BlackBerry. We need to support both keyboard clicks as well as touch events. Ideally I'd just…
DA.
  • 39,848
  • 49
  • 150
  • 213
207
votes
12 answers

How do I programmatically click a link with javascript?

Is there a way to click on a link on my page using JavaScript?
Jason Kolok
185
votes
9 answers

HTML "overlay" which allows clicks to fall through to elements behind it

I'm trying to overlay a element on top of a webpage (to draw arbitrary graphics), and I've come to the point where I can stack it inside of a element on top of everything, but this prevents the user from clicking on any links/buttons/etc. Is there…
Steven Schlansker
  • 37,580
  • 14
  • 81
  • 100
176
votes
10 answers

Can I call jQuery's click() to follow an link if I haven't bound an event handler to it with bind or click already?

I have a timer in my JavaScript which needs to emulate clicking a link to go to another page once the time elapses. To do this I'm using jQuery's click() function. I have used $().trigger() and window.location also, and I can make it work as…
Mnebuerquo
  • 5,759
  • 5
  • 45
  • 52
170
votes
8 answers

An error occurred: @Output not initialized

I'm working on an angular app for managers to keep track of their teams, and I'm stuck with an @Output error : An error occurred: @Output deleteMeeting not initialized in 'MeetingItemComponent'. I have a Meetings component, generating a list of…
Apollo
  • 1,703
  • 2
  • 7
  • 4
160
votes
12 answers

How to make a whole 'div' clickable in html and css without JavaScript?

I want to make it so that a whole div is clickable and links to another page when clicked without JavaScript and with valid code/markup. If I have this which is what I want the result to do -
This is a link
The W3C…
Andy Lobel
  • 3,356
  • 9
  • 31
  • 40
141
votes
9 answers

How to handle ListView click in Android

How do I listen to click event on a ListView? This is what I have now ListView list = (ListView)findViewById(R.id.ListView01); ... list.setAdapter(adapter); When I do the following list.setOnItemSelectedListener(new…
teepusink
  • 27,444
  • 37
  • 107
  • 147
140
votes
5 answers

jQuery: fire click() before blur() event

I have an input field, where I try to make autocomplete suggestion. Code looks like
On input's blur() event I want to hide results' div: $("#myinput").live('blur',function(){ …
Egor Sazanovich
  • 4,979
  • 5
  • 23
  • 37
139
votes
9 answers

python selenium click on button

I am quite new to python selenium and I am trying to click on a button which has the following html structure:
AJW
  • 5,569
  • 10
  • 44
  • 57
1
2 3
99 100