Let’s say that instead of looking at the ID, I want to select all a.href that contain (a piece of) this example document.url “www.youtube.com”
var youtubeID= document.querySelectorAll('.youtubelink');
var youtubeDiv = document.querySelectorAll('a[href^="http://www.youtube.com"]');
New contributor
Mediamash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.