โPure Javascriptโ versus โjQueryโ is an issue for many developers of client side web application code logic. More often than not we plump for the former, though there are notable exceptions for us, such as jQuery Ajax is often of use, and we have used the very apt (for todayโs topic) jQuery CSS on occasions. But for todayโs proof of concept test run of โฆ
document.querySelectorAll([CSS-selector]);
โฆ itโs all โPure Javascriptโ. In todayโs qsallhtml HTML and โPure Javascriptโ code you will not find the string โdocument.querySelectorAllโ anywhere because our web application is โฆ
- just some header HTML elements and one HTML input type=text โtextboxโ element and one containing div element and one input type=text to avoid โtabbing outโ annoyances โฆ
- โtextboxโ accepts a relative URL in two parts as per โฆ
[relativeURLTo-//www.rjmprogramming.com.au/]#[CSS-selector] - that relative URL is the โsrcโ property to an HTML iframe element that overlays (made to be barely visible) header HTML elements and one HTML input type=text โtextboxโ element โฆ and whose โฆ
- โonloadโ event logic goes โฆ
function checkif(iois) {
var ij;
if (iois != null) {
var aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (selectoris != '') {
eles=aconto.querySelectorAll(selectoris);
for (ij=0; ij<eles.length; ij++) {
eles[ij].style.border='1px dashed red';
}
}
}
}
}
โฆ that you can try for yourself with todayโs liverun link.
If this was interesting you may be interested in this too.