Linked Questions
135 questions linked to/from Difference between .on('click') vs .click()
10
votes
3
answers
15k
views
Difference between `$(document).on("click", "a"` and `$("a").click(` [duplicate]
Can Anybody tell me what will be the difference between these two script,Am not a javascript/jquery expert.
$(document).on("click", "a", function () {
i = $(this).data("value");
alert(i)
})
$...
2
votes
3
answers
4k
views
Is there a difference between .change() and .on("change")? [duplicate]
Is there any difference between :
$('selector').change(function() {});
and
$('selector').on("change", function() {});
And if there is, which one should I use in most cases?
0
votes
2
answers
409
views
When to use on() and click() in jquery [duplicate]
What is the difference between using on() and click() in jquery.?
For example:Both work the same way:
$(".classname").click( function() {
var toAdd = $('input[name=checkListItem]').val();
...
1
vote
1
answer
942
views
Difference between onclick() and .on('click',function())? [duplicate]
$(document).ready(function(){
// Add smooth scrolling
$('.button').children().onclick(function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash ...
0
votes
3
answers
236
views
Whats the difference between using .on('click' and .click? [duplicate]
Possible Duplicate:
Difference between .on('click') vs .click()
When handling a click of a div whats the difference between using .on and .click :
$('#myDiv').on('click' , function(...
0
votes
2
answers
75
views
event propagation event binding [duplicate]
What is the different between:-
$("#btn").click(handler);
and
$("#btn").on('click', handler);
Both of the above will bind a handler to the element on click event. When to use which one?
0
votes
1
answer
117
views
jQuery event-handlers [duplicate]
I have been searching around without finding an satisfying answer. What is the difference between the 2 following event-handlers.
$('#div').on('click', function(){
//do something
});
and
$('#...
0
votes
2
answers
81
views
Unable to add css property to <td> element by clicking on it [duplicate]
I am trying to build a pixel marker webpage for a project. It is almost completed. I am facing a couple of problems:
Unable to fill in the color, when a <td> tag is clicked.
The wells that ...
2
votes
0
answers
50
views
jQuery change icon on click [duplicate]
noob question here (beginner to JavaScript & jQuery). I am learning code via codecademy etc., and they are teaching to use the following:
$('.projects-button').on('click', function() {
$('....
0
votes
0
answers
32
views
when do we need a selector with jquery on click [duplicate]
Hi Editor: this is not a question about: .on('click') vs .click
HTML:
<div id="menu">
<div id="someID">
<a href="#">click</a>
</div>
</div>
...
624
votes
16
answers
1.1m
views
Passing data to a bootstrap modal
I've got a couple of hyperlinks that each have an ID attached. When I click on this link, I want to open a modal ( http://twitter.github.com/bootstrap/javascript.html#modals ), and pass this ID to the ...
47
votes
4
answers
49k
views
How to unbind a specific event handler
Code:
$('#Inputfield').keyup(function(e)
{
if(e.which == 13)
{
functionXyz();
}
else
{
...
7
votes
4
answers
28k
views
jQuery hide() animation slide right
Using jQuery's hide() function with the optional duration parameter I'm able to get some alert boxes on my site to gracefully slide off screen and disappear.
It appears that the default direction for ...
14
votes
3
answers
28k
views
.change() vs .on( "change", handler ) in jQuery
I have an issue when I use jQuery to handle the trigger of change on my drop-down.
I use 2 pieces of code:
//---------- Case 1
$(document).on("change", "#drop-down-id", function () {
alert(this....
4
votes
3
answers
29k
views
How can I add onclick events to Wordpress Menus
I'm trying to add an onclick event to a WordPress menu that uses a nav walker. While I understand code and php I'm not very experienced with the WordPress system nor would I could myself an ...