Is there a one lined way to hide all of a certain type of elements in one selector. I know you could do this:
$('p').hide();
$('p:first(or :eq(0)').show()
Possibly something like this:
$('p:eq(>0)')
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
slice()will probably give the best performance:…where
1is the second element in the results and0would be the first. This is faster because it uses native methods instead of a custom filter.Alternatively, you could use
:not()or.not():