jquery on method with load event

0 votes

How can we use jQuery .on() method with load event? e.g. The code is:

<a href="#" id="add">Add</a>
<div id="initial">
     <input type="text" class="abc" name="in">
</div>

And the jQuery for it:

jQuery(document).ready(function() {
    var x=$('#initial').html();
    $('#add').click(function(){
        $('body').append(x);
    });
    $(document).on('load','.abc',function(){
        alert('started');
    });
});

Aug 4 in Web Development by gaurav
• 17,580 points
25 views

1 answer to this question.

0 votes

load() . The load() method attaches an event handler to the load event. The load event occurs when a specified element has been loaded. This event works with elements associated with a URL (image, script, frame, iframe), and the window object.

answered Aug 4 by rajatha
• 7,040 points

Related Questions In Web Development

0 votes
0 answers

Event handling with jQuery, AMD and require.js

I am very new to AMD and ...READ MORE

Jul 29 in Web Development by gaurav
• 17,580 points
10 views
0 votes
1 answer

How to track with Google Analytics on a redirection page with PHP?

Hello @kartik, Since the page that is sending ...READ MORE

answered Jul 7, 2020 in Web Development by Niroj
• 82,740 points
931 views
0 votes
1 answer

Error: Failed to load resource: the server responded with a status of 404 (Not Found)

Your files are not under the JSP folder that's ...READ MORE

answered Dec 16, 2020 in Web Development by Gitika
• 65,870 points
59,499 views
0 votes
1 answer

Check if checkbox is checked with jQuery

To check whether a Checkbox has been ...READ MORE

answered Jun 23 in Web Development by rajatha
• 7,040 points
32 views
0 votes
0 answers

jQuery UI Sortable and two connected lists

I am trying to put together the ...READ MORE

Jul 19 in Web Development by gaurav
• 17,580 points
11 views
0 votes
0 answers

jQuery : Detect when element is scrolled to

I'd like to detect when an element ...READ MORE

Jul 28 in Web Development by gaurav
• 17,580 points
9 views
0 votes
1 answer

How to use jquery with asp.net ajax?

If you weren't aware, Microsoft is planning ...READ MORE

answered Oct 15, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
190 views
0 votes
1 answer

Is 'sparkline' a method?

I suggest you to check 2 things That jquery.sparkline.js is actually ...READ MORE

answered Nov 9, 2018 in Apache Spark by Frankie
• 9,830 points
601 views
0 votes
1 answer
0 votes
1 answer

How to use JQuery with ReactJS

Yes, we can use jQuery in ReactJs. ...READ MORE

answered Jun 22 in Web Development by rajatha
• 7,040 points
16 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP