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 8247509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:52:15+00:00 2026-06-07T22:52:15+00:00

I am trying to dynamically iterate through a list and bind each ‘li’ element

  • 0

I am trying to dynamically iterate through a list and bind each ‘li’ element with a dblclick event.

What I want is to be able to do something like the following:

var sorttList = document.getElementById("list1");
for (var k = 0; k < sorttList.childNodes.length; ++k) {
    sorttList.childNodes[k].bind('dblclick', function() {
        //some event
    });
}

When I attempt to do so, I get the error “Uncaught TypeError: Object #HTMLLIElement has no method ‘bind'”

What is the appropriate syntax for this task?

  • 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-07T22:52:16+00:00Added an answer on June 7, 2026 at 10:52 pm

    bind() is not part of vanilla JavaScript. Your intention is probably to use the bind() function that is part of the jQuery library.

    If you are not using jQuery, you need to get it, then update your code to use jQuery selectors and to pass around jQuery objects.

    If you are already including jQuery in your page, then you need to make sure that you’re calling bind() on a jQuery object. Change:

    sorttList.childNodes[k].bind('dblclick', function() {
    

    to

    $(sorttList.childNodes[k]).bind('dblclick', function() {
    

    This isn’t a perfect solution, but hopefully this will demonstrate how $() when using jQuery will return a jQuery Object, not a standard HTML element JavaScript object. The bind() method exists on a jQuery object, but not a standard DOM object like the one you’re using.

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

Sidebar

Related Questions

I am trying to dynamically change an element's onClick event and I have something
I am trying to build a dynamically generated unordered list in the following format
I am trying dynamically to append an <svg> element to an existing SVG island
I'm currently trying dynamically create an html table in PHP. Further, I want the
I'm trying to dynamically create a bunch of class properties, but each dynamic fget
I am trying to dynamically have my javascript look for an element ID in
I'm trying to dynamically bind mysql_stmt parameters and get the result in an associative
I'm trying to build something like the C# type initalizer dynamically: MyClass class =
I'm trying to dynamically set a div id through jQuery. Yesterday, it seemed like
I'm trying to loop through the contents of a stream to dynamically generate nodes

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.