How to hide div that without id/class by jquery? -


how hide first/second div jquery?

div can not id/class!

<body> <div> <p>ssssssss</p> </div> <div> <p>ttttttttt></p> </div> <div> <p>fffff</p> </div> </body> 

to hide first <div> element, do:

$("div:eq(0)").hide(); 

to hide second <div> element, do:

$("div:eq(1)").hide(); 

to hide both first , second <div> elements, do:

$("div:lt(2)").hide(); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -