I want to add EventListener to all input className that will disable space when typing using oninput.
input class="inputX" id="idA"></input>
input class="inputX" id="idB"></input>
input class="inputX" id="idC"></input>
input class="inputX" id="idD"></input>
Im using FOR statement and still nowhere.
It can be done if im using getElementById but not with getElementsByClassName/Name and even with querySelectorAll (which I believe there is some code missing).
I found JQuery code but I dont know how to write it back in Javascript.
$(".inputX").keyup(function() {
$(this).val($(this).val().replace(/s/g, ""));
Hope someone can help me out ~ Thanks
Manage to disable space when using getElementById (as below), but how to use getElementsByClassName?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…