how to find all elements with an attr in jquery?

how to find all elements with an attr in jquery?

I found this example but it specifically searches all inputs as opposed to all elements:

 

https://api.jquery.com/attribute-equals-selector/

 

How can I update this example to search *all* elements in the DOM, not just inputs for those that contain a particular attribute like "myAttribute"?