Use the “has attribute” selector:
$('p[MyTag]')
Or to select one where that attribute has a specific value:
$('p[MyTag="Sara"]')
There are other selectors for “attribute value starts with”, “attribute value contains”, etc.
More Related Contents:
- How to get the children of the $(this) selector?
- Get selected text from a drop-down list (select box) using jQuery
- Is there a case insensitive jQuery :contains selector?
- jQuery get specific option tag text
- How do I get jQuery to select elements with a . (period) in their ID?
- document.getElementById vs jQuery $()
- jQuery to loop through elements with the same class
- jQuery selectors on custom data attributes using HTML5
- What is “context” in jQuery selector?
- jQuery’s .bind() vs. .on()
- How can I get selector from jQuery object
- How to get all options of a select using jQuery?
- jQuery DOM changes not appearing in view source
- Testing if a checkbox is checked with jQuery
- Selecting multiple classes with jQuery
- How do you check if a selector matches something in jQuery? [duplicate]
- Not class selector in jQuery
- jQuery single selector vs .find()
- jQuery select and wrap textNode
- Using jQuery to search a string of HTML
- Count immediate child div elements using jQuery
- jQuery find and replace string
- How to get text node after element?
- jQuery support “:invalid” selector
- Find HTML based on partial attribute
- Combine two selectors with one jQuery object
- How to select empty inputs (value=””) using jQuery
- What is the new proper way to use a child selector with a context node in jQuery?
- jQuery: Select data attributes that aren’t empty?
- Why do functional pseudos such as :not() and :has() allow quoted arguments?