jQuery's .children() vs .find()
Writing a dialog pop-up for a mobile app I'm currently developing, I found that I couldn't get the dialog to update with new content even though the functions were being passed the correct argument.
$header = $page.children( ":jqmData(role=header)" ),
$content = $page.children( ":jqmData(role=content)" )
Changing the method to .find() made everything work as it should:
$header = $page.find( "div:jqmData(role='header')" ),
$content = $page.find( "div:jqmData(role='content')" )
Written by Mozart Reina
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#