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

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -