javascript - Find element from jQuery matching objects -
javascript - Find element from jQuery matching objects -
i have click event listener below:
$(".clickable").click(function (e) { var results= $(e.currenttarget).closest('div.set').find('.clickable'); // returns //[<label for="thumbnail" class="clickable">1 malaysia</label>, //<div class="thumbnail clickable">…</div>] var label = $(results).find('label'); // returns [] (empty list) }
my problem is, how can select label element results
list ? !
try utilize .filter()
instead of .find()
,
var label = results.filter('label');
.find()
search descendants, here in need filter out required element collection, utilize .filter(selector)
here.
and have used satpal said like,
var results= $(e.currenttarget).closest('div.set').find('label.clickable');
javascript jquery
Comments
Post a Comment