Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9146577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:46:58+00:00 2026-06-17T10:46:58+00:00

I have known for a while now that .on is supposed to replace .live,

  • 0

I have known for a while now that .on is supposed to replace .live, however I have never been able to get it to work at all.

I have tried:

$(this).on('click', function(){
    // Do something...
})

$(this).on({
    click: function(){ // Do something }
})

But it never works for me!

Specifically when I’m trying to bind events to elements that may not exist on the page initially.

Could someone please clear this up for me once and for all?


I’m using the latest version of jquery.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:46:59+00:00Added an answer on June 17, 2026 at 10:46 am

    For dynamically generated elements you need to use like

    $(document).on('click','YOUR SELECTOR', function(){
    
    });
    

    It’s because document is the container of your elements which can watch changes to the DOM. For every action, there needs to be an explicit event listener. If you bind something to $(this), it (the selector) might not exist when you remove it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have played around with Scala for a while now, and I know that
i have a question, been stuck for a while, i dont know how can
As you may have known that I switched from ubuntu to windows from my
Scala programmer should have known that this sort of writing : class Person{ var
I have a variable known as $SessionMinus. What I want to do is that
I have a rectangle which has known width and height.Now devide rectangle diagonally to
I have a string that contains a known number of double values. What's the
I've been using J for a few months now, and I find that reading
I have an application that is supposed to be localized (two languages, english being
First of all, until now, all my programming education, has been targeted to console

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.