Linked Questions
133 questions linked to/from Direct vs. Delegated - jQuery .on()
11
votes
2
answers
17k
views
jQuery on() selector [duplicate]
What is the purpose of the selector in the jQuery on() method?
In what situation is
$("#fish").on("click", ".button", function() {
// something
});
better than, say,
...
7
votes
2
answers
26k
views
JQuery .on("keydown") Not Working When Appended To Page [duplicate]
I have a side menu of which you can right-click and choose to rename. This removed the <a href="... from the <li></li> and adds an input field. I cannot seem to have this appended input ...
4
votes
4
answers
9k
views
jQuery Click Function Different Methods [duplicate]
Hi I have a Ajax call that I'm doing with jQuery and was wondering what is the difference between these methods on selecting an element on click,
FIRST
$(this).on('click', 'button', function (){ });...
-5
votes
3
answers
5k
views
jQuery: .click doesn't work on appended div [duplicate]
please help me out with this issue: both .click and .on are not working when i am clicking on appended
$(document).ready(function() {
$( ".cooldiv" ).click(function() {
alert(1);
});
...
5
votes
1
answer
4k
views
Difference between $(document).on and $('#submit').on [duplicate]
Please let me know the difference between the followings.
I am new to these kind of action.
$('#myButton').on('click', function () {
// Some code
});
and
$(document).on('keyup'...
0
votes
1
answer
3k
views
How do I bind an event listener to dynamically generated content? [duplicate]
I'm attempting to dynamically expose deeper levels of navigation by injecting html into empty divs. While the html is being successfully injected into the 2nd nav level, I can not get the html to ...
0
votes
2
answers
2k
views
Jquery 1.10.1 click on (Event delegation issue) [duplicate]
Please take a look at this jsFiddle. Based on a click, an appended class is added to div. I'm trying to click based on the class and get a response. Your help is greatly appreciate!
jQuery(...
0
votes
1
answer
2k
views
Jquery load not working on loaded content [duplicate]
I am using this code to populate the html pages to a div.
$(document).ready(function(){
// Load Home Content
$('#content').load('pages/sample.html');
//...
0
votes
2
answers
2k
views
How to make event listener for changes in all and any check boxes in document with javascript/jquery? [duplicate]
what I'd like is to be able to create an event listener for all and any check boxes in a document. Because check boxes and radio buttons will be added dynamically with JavaScript, rather then have a ...
0
votes
1
answer
969
views
Adding event handler to dynamically added span elements [duplicate]
I want to bind a click even to the dynamically added span elements to a node on my page.
I wrote the bind event for a single static element and it works fine -
function clickSpan(domNode){
$(...
4
votes
3
answers
442
views
Attach attribute [data-name] then click using this data attribute [duplicate]
I'm trying to add a data-name attribute on clicking one element and then when that element is clicked do something else.
$(".btn01").on("click", function() {
$(".next").attr("data-name", "btn02");...
1
vote
1
answer
927
views
DataTable (CodeIgniter 3 & Bootstrap 4) - Clicking the row action buttons not opening modal [duplicate]
I am using a DataTable from bootstrap 4 and has successfully loaded data on it but the problem is that whenever I click a row action button (delete or edit) it does not open their respective modal.
...
0
votes
2
answers
540
views
How to call jQuery click event from innerHTML? [duplicate]
In my javascript on load in my index.html, I am getting the data from my backend (Flask app) and putting in a javascript variable. The reason why i am doing this is that while I can directly inject ...
2
votes
2
answers
436
views
How to bind image load callback for dynamically added images? [duplicate]
On the initial page load, the image load callback gets invoked. I use knockout to add dynamic images to the page. When I do that, however, the image load callback is not being invoked. Is there a work ...
1
vote
3
answers
199
views
Jquery Difference B/w Jquery bind events [duplicate]
What is the difference Between the following statements. Which one should I choose over one another in a situation.
$(document).on("click","#btn",callback);
$("#btn").on("click",callback);