JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<input type='text' data-media-1='1' value='1' />
<input type='text' data-media-2='2' value='2' />
<input type='button' data-media-3='3' />
<input type='text' test='test' value='3' />
</body>
JavaScript
var el = document.body.childNodes;
var arr = [];
for (var i=0; i<el.length ; i++){
var temp1 = el.item(i).nodeName;
if( temp1.indexOf('#') == -1 ) {
//as attr data-media-* is the second attr (attributes[0])
var temp2 = el.item(i).attributes[1].name;
if( temp2.indexOf('data-media-') != -1 )
arr.push(el.item(i));
}
}
console.log(arr);