html - How to access DOM from previous sibling in JavaScript? -


i trying id(id 1) name of div div(class 2) in next line. when use previoussibling, worked on google chrome not on safari since safari catches area between divs "#text". in code, id name unique , there many different id name not want find id name. there way access previous sibling??

<div id="parent">  <div id="1">   <div class="1-1"></div>   <div class="1-2"></div>  </div>  <div class="2"></div> </div> 

when use previoussibling, worked on google chrome not on safari since safari catches area between divs "#text".

it works. doesn't want do. returns sibling nodes. in case textnode.

what looking element, specific subclass of node. there's .previouselementsibling property.

inspecting dom node debugger , looking documentation on available properties way find such things.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -