Cannot select input jquery -
it's simple question, dont know how .
<div> <input> </div> <p id="pepe"></p>
the following :
$("#pepe").prev()
gives me div, how first child (input)
as you've seen prev()
gets previous sibling element. input
there need use find()
, along :first
assuming there multiple within actual working html:
$("#pepe").prev().find('input:first');
Comments
Post a Comment