JSFiddle - React, Tailwind, and code Playground
HTML
<input id="abc-1">
<select id="abc-2"></select>
<textarea id="abc-3"></textarea>
<div id="abc-4"></div>
<p id="abc-5"></p>
JavaScript
originalQuerySelectorAll = document.querySelectorAll;
console.log(originalQuerySelectorAll);
document.querySelectorAll = function() {
var selector = arguments[0];
if (/\:any/.test(selector)) {
if ("webkitAnimation" in document.body.style) {
selector = selector.replace(/\:(any)/g, ":-webkit-$1");
}
if ("MozAnimation" in document.body.style) {
selector = selector.replace(/\:(any)/g, ":-moz-$1");
}
}
return originalQuerySelectorAll.call(document, selector)
}
var tagId = "abc";
var elems = document.querySelectorAll("[id^=" + tagId + "]:any(input, select, textarea)");
console.log(elems)