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
2 answers

Check and uncheck checkbox and read its state

How can I read the state of my checkbox and set it's state to be visible ? I'm trying something like this, but it always returns true: $('.show-check').live('click', function(e) { e.preventDefault(); var checked =…
mortar
  • 1
0
votes
0 answers

jQuery scroll function doesn't work

I have a scroll function on my page that loads when the url is .../originalmusic.html#prices, when '#prices' is added it flicks down to the Prices section with id="prices". So it works quite alright, but I want it to animate scrolling down and I…
0
votes
4 answers

How can I access variables sent in the request via jQuery?

I'm using struts. My ActionForm has an ArrayList set up within it, how can I access the array from the JSP that the ActionForm is sent to by the controller in jQuery on a button click. This is so I can loop through the elements of that array. I…
edwardmlyte
  • 15,937
  • 23
  • 58
  • 83
0
votes
1 answer

.css("transform") returns unexpected value matrix(1, 0, 0, 1, 0, 2000) instead of translateY(2000px)

The jQuery function is suppose to transform the ".circle1" div up and down upon clicking "#ring" but unfortunately, it is not functioning. I can't seem to spot any errors so any help is appreciated. Thank you for your guidance. //..HTML..//
0
votes
1 answer

Chrome Browser becomes laggy after an onClick event

I am developing a parallax solution for my website which gets the mouse position every time the user moves the cursor. The problem that I ran into was that when I click anywhere on the document, the browser becomes laggy and jittery. I am able to…
0
votes
2 answers

jQuery script working after the DOM has loaded within a .click event?

I am trying to find out how to get a jQuery script to work correctly when a click event is started, the script calculates the height of a container (this script appears at the start of the page on load and works 100%) but I am now trying to get it…
zealisreal
  • 495
  • 2
  • 8
  • 20
0
votes
1 answer

jQuery on() Method

I can't make this work, I already read all i could find on the subject. Sure you can help me. I simply need that the button with id "next" log on the console a random number when is clicked.. her is the html of the button:
0
votes
4 answers

jQuery click action does not trigger onclick attribute

I am having problems getting a function that clicks all search matched checkboxes. The click event seems to fire, but no checkbox gets checked nor is myFunc() called. It works perfectly when clicking each checkbox manually, but who wants to do that…
Kim
  • 2,747
  • 7
  • 41
  • 50
0
votes
1 answer

jQuery Click Function Not Working

jQuery click function not working properly. Actually it works but I'm loading my HTML via JavaScript call after pageload, in this condition jQuery click function not working. HTML part: …
Deniz B.
  • 2,532
  • 1
  • 18
  • 35
0
votes
1 answer

How to differentiate the click event based on clicked DOM node?

How can I change the method's behavior based on which node was clicked? I want to change the data attribute's value to 0 if the $('.parent') was clicked. $('.parent').on('click', function (event) { …
Runtime Terror
  • 6,242
  • 11
  • 50
  • 90
0
votes
2 answers

JavaScript / jQuery - Any way to detect click type?

In my code I use jQuery's click() function. Is there any way to detect click type? For example the ability to differentiate between mouse clicks and code driven clicks?
Alex
  • 1,982
  • 4
  • 37
  • 70
0
votes
1 answer

Click event after append Jquery

I'm playing around with some Jquery, json and Ajax. If the fa-plus got clicked it needs to disappear and fa-mines needs to show. the problem is it doesn't do anything. not even the console.log('clicked') I've got document ready and:…
Floeske
  • 100
  • 1
  • 12
0
votes
3 answers

Web development : how to make button click event download a file using html + jQuery?

I need to create an html script that create a table of contact and using the jQuery. I am trying to download this html page and convert it to excel file. can anyone help me ?? I have this html file contact.html
user2053793
0
votes
1 answer

How can I apply jQuery.click to click first level of an item automaticlly?

I use this jquery menu lib for a sliding menu:http://mmenu.frebsite.nl/ Live demo: http://jsfiddle.net/p9ynx8wc/3/ It opens the menu and the sub-menu when I manually mouse click. Now I want to open the menu and the submenu via jquery click; I can…
partiz
  • 1,206
  • 2
  • 13
  • 34
0
votes
1 answer

Adding a click event to an element on "body" causing memory Leak in IE8

while working on my project we are facing a memory leak in IE8 and as I don't have much clue about where this was happening I did some trials and found that the leak was happening when ever I include this piece of…