I’m in the need for a jquery selector to get all p elements that has some attribute set, no matter the value and no matter the attribute name.
XPath related expression is:
"//p[@*]"
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.
If you’re saying that you want
<p>elements that have at least one inline attribute set, you could do this:Example: http://jsfiddle.net/ZRPv4/
This will give you a set of
<p>elements that have at least one inline attribute set.It tests the
lengthproperty of theattributesarray associated with the current<p>in the iteration. If thelengthis0, it will be removed from the result.Here’s a custom selector version:
Example: http://jsfiddle.net/ZRPv4/1/