Things I learned the hard way XIVII

jQuery When the DOM isn't reacting to your javascript selectors as expected try a little specificity: instead of this:
  $("#item_id > a")
do this:
  $("#item_id > ul > li > a'")

Posted by jeremy Sun, 14 Feb 2010 23:41:00 GMT


Comments

Leave a response

  1. Zack Kitzmiller 7 days later:

    You’re first code block shouldn’t work.

    the ‘>’ denotes a ‘child element,’ and ‘a’ is not a child of #item_id, but a great-grand child.

    $(’#item_id a’) would be the proper selector, as it would match ALL generations under ’#item_id’

Leave a comment