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

  • Home
  • SEARCH
  • 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 8670821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:47:52+00:00 2026-06-12T18:47:52+00:00

I am adding some html to the DOM after the document has loaded via

  • 0

I am adding some html to the DOM after the document has loaded via jQuery (and a follow-up to this but not that relavant how to access outside selector in this example). I would like to bind a ‘keyup’ to input elements that are wrapped in class ‘.item-vals’. My understanding is that the first syntax should limit the testing by jQuery for that event to only elements that exist in the class ‘.item-vals’. Since ‘.item-vals’ would be more specific, I think it would perform better than using document. Is there a way to make the second syntax work?

// doesn't work
$('.item-vals').on('keyup','input',function(){

// does work
$(document).on('keyup','.item-vals input',function(){

thx in advance (and sorry for all jQuery questions)

  • 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-12T18:47:54+00:00Added an answer on June 12, 2026 at 6:47 pm

    .live is deprecated. Don’t use it.

    Instead of document use a container div so that the event doesn`t have to bubble to the top.

    $('#MyContainerThatExistsOnPageLoad').on('keyup','.item-vals input',function(){
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm adding a Facebook 'like' button to the DOM using this jQuery plugin: http://onerutter.com/open-source/jquery-facebook-like-plugin.html
I've tried some HTML DOM code from several sites, but it isn't working. It
I load some html using AJAX, this works fine, one of the bits that
I have a class that generates some html (form elements and table elements), but
The idea is to create a DOM-like tree. But there are some restrictions, that
I have some code that works fine but it's become too slow: HTML: I
//html structure <div id='outer'> <div id='inner'> </div> </div> I am adding some data to
Background I'm adding some features to a project that uses subversion - I'm using
Wasn't too sure exactly how to title this question, but here's the issue that
I'm currently writing a function for parsing some HTML and adding tags where necessary.

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.