javascript - jquery .find() not working as expected on ipad -
i have html:
<div id = "note"> <div id = "selection"></div> <div id = "element"></div> </div> <div id = "note"> <div id = "selection"></div> <div id = "element"></div> </div> <div id = "note"> <div id = "selection"></div> <div id = "element"></div> </div> and jquery code:
$("[id=note]").each(function(){ $(this).find("#selection").css("left", left).css("top", top); }); when using desktop works expected. when using ipad (safari or chrome) - @ end of .each function elements id = "#selection" having same left , top.
i used wen inspector debug code, , in console when run $(this).find("#selection") 3 elements having id = "#selection"
do miss something? there known issue using ".find()" on ipad?
use class instead of id. beacuse id unique in html
$("[class=note]").each(function(){ $(this).find(".selection").css({"left":left , top : top}); }); javascript jquery html ipad jquery-find
No comments:
Post a Comment