Questions tagged [jquery-click-event]

The jQuery click event is a wrapper around the default browser "onclick" event.

The jQuery click event is basically a wrapper around the default browser "onclick" event. In jQuery, it provides the option to handle and trigger the mouse "onclick" event. The onclick event is being sent on an element when the mouse pointer is over that element, right after the mouse button is pressed and released.

Example

Binding click event handler

$("selector").click(function(){
  // do something
});
// Or
$("selector").on("click", function(){
  // do something
});

Reference

238 questions
0
votes
1 answer

click event not working

I have used live() to create a click event, on the table row, but the data in the table was getting cached, and then after some googling, I discovered that on() is the correct way to add an event to the selector. $('#landingContactTable tbody…
Harbir
  • 453
  • 1
  • 7
  • 24
0
votes
1 answer

jQuery click event on IE7-8, does not execute on the div, only on its text

I have a problem using the jQuery click event with IE7-8-9. I apply the event on a div. But on these two IE versions, I have to click on the text contained within the div to make the event work. I don't understand because it was still normally…
0
votes
1 answer

HTML5 canvas/Jquery mousemove + mouseclick event

I'm trying to get a a simple interactive cannon that moves in a 180 degree arc which follows your mouse. And then, I want it to shoot cannonballs everytime you click anywhere on screen. I'm using HTML5 canvas and/or jquery to do the job, so far I…
0
votes
5 answers

Jquery on event not working for Dynamic elements

$(".spanCont:first .collection_shop").on("click",function(){ var current_item = $(this); $.ajax({ url: "ajax/abc.php", type: "POST", dataType: 'html', data:…
Wasim A.
  • 9,660
  • 22
  • 90
  • 120
0
votes
1 answer

Trigger onclick function of input that has been checked automatically with jQuery

I have a form with some checkboxes which go like this: Conditioned on another input I can have these checkboxes checked automatically but for some reason I…
user2017642
0
votes
1 answer

stopPropagation not working in this instance

Okay so a simple thing that I don't know how to search for, wasn't able to get an answer anywhere... Basically, I'm using XML to populate a list. What happens is when clicking on the first tier li, it adds all the different suburbs to the child ul.…
Hiriji
  • 69
  • 1
  • 9
0
votes
5 answers

JQuery Toggle Image not working

I am simply trying to toggle the image source with a click using JQuery. My script is below, I am not sure why it's not toggling. When the page first loads, if you click the gray image, it toggles to the color image. But if you click the gray…
thenextmogul
  • 1,143
  • 2
  • 10
  • 20
0
votes
1 answer

How do I stop my accordion from popping the first time it's clicked?

I have a problem with my accordion. The first time I click any of the title bars to collapse that item, it has a sharp pop to close it. I'm using slideUp(), but it doesn't appear to be used initially. If I keep clicking the title bar for that item,…
Pegues
  • 1,693
  • 2
  • 21
  • 38
0
votes
1 answer

Perform redirect without bubbling click event

I have an anchor element inside a div. I'm listening to both elements click event. When the user clicks the 'a' element, I need to prevent the click event bubble. But I need to keep the anchor working: the user has to be redirected to 'href'…
0
votes
4 answers

No text change of anchor on toggle

No text change of anchor on toggle please provide me some suggestion Html: +Flight Details
Arun
  • 257
  • 1
  • 5
  • 22
0
votes
2 answers

Retrive the Checkbox value and how to add the values of checkbox

Need to get the values of checkbox and need to store in a single variable by adding all values instead of storing in array.how should i get it.? here my fiddle and my jquery function getCheck() { $('ul.addon > li :checked').each(function()…
user1999510
0
votes
1 answer

the .click event not working ONLY for the last button (events defined in a for-loop)

I made a function that sets .click for the number of buttons passed to it. The function is called when another Jquery detects the number of buttons on the page ... var n = $(".button").length + 1; ... set_navig(n); ... function set_navig(n){ …
0
votes
3 answers

Function on Click doesnt work

I have to use dynamically created images for my projekt. I do this with jQuery: var img = $('').attr({ 'id': i, 'src': e.files[i].thumbnails["200x200"], 'alt':e.files[i].name, 'class': 'photo'}).appendTo($('#img')); But I can't run a…
custi
  • 553
  • 1
  • 4
  • 11
0
votes
2 answers

jQuery event handler differences

Here are two different ways of writing event handlers: $('element').on("click",function(){ // do stuff }); vs $('element').click(function(){ // do stuff }); What are the key differences between the two? What situations would one be better…
Ryan
  • 6,027
  • 16
  • 52
  • 89
0
votes
1 answer

Why won't jQuery click event fire?

The following jquery code snippet will not fire on click. Can you help me figure out why? StackOverflow says I need more details. I apologize. I can't think of any further relevant details. The code seems pretty self-explanatory to me. If you think…