javascript get element by tag and attribute

JavaScript
//find first element with "someAttr" attribute
document.querySelector('[someAttr]')
//find all elements with "someAttr" attribute
document.querySelectorAll('[someAttr]') 

Source

Also in JavaScript: