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, 2022 in Web Development by gaurav
• 23,260 points
2,861 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, 2022 by rajatha
• 7,640 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, 2022 in Web Development by gaurav
• 23,260 points
337 views
0 votes
0 answers

Grab computed background-size on Internet Explorer with jQuery

I have this style: #bkg-evs-1 { ...READ MORE

Aug 19, 2022 in Web Development by gaurav
• 23,260 points
270 views
0 votes
0 answers

Angular + jQuery .on() doesn't work with ng-repeat

jQuery .on() is not working with ng-repeat, when I ...READ MORE

Aug 22, 2022 in Web Development by gaurav
• 23,260 points
623 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,880 points
1,588 views
0 votes
0 answers

jQuery UI Sortable and two connected lists

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

Jul 19, 2022 in Web Development by gaurav
• 23,260 points
1,044 views
0 votes
0 answers

jQuery : Detect when element is scrolled to

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

Jul 28, 2022 in Web Development by gaurav
• 23,260 points
215 views
0 votes
0 answers

jQuery Event.Target for caller's reference

I don't know if I have forgotten ...READ MORE

Aug 19, 2022 in Web Development by gaurav
• 23,260 points
361 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
538 views
0 votes
1 answer

Jquery pickatime, Drop down window not closing after on change event

Maybe your input element falls within label ...READ MORE

answered Aug 2, 2022 in Web Development by rajatha
• 7,640 points
388 views
0 votes
1 answer

How to use JQuery with ReactJS

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

answered Jun 22, 2022 in Web Development by rajatha
• 7,640 points

edited Dec 15, 2023 by Soumya 13,915 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP