What is the best way to add oninput = "insertScriptHere,insertScript2Here"
to a data table, if the table already has oninput = "insertScriptHere
already? I only want the second script to join onto the oninput after a button press.
To reiterate: I have <input type="number" placeholder="-" size="2" maxlength="3" id="s1g1" oninput="constraint(this)">
and I want it to change to <input type="number" placeholder="-" size="2" maxlength="3" id="s1g1" oninput="constraint(this),autoEnable()">
after I have clicked the button.
The Button: <button id="calcGrades" onclick="calcGrades(),autoEnable()">Calculate Final Grades</button>
So far I have tried: document.getElementById("s1g1").setAttribute("oninput","script1(),script2()");
document.getElementById("s1g2").element('onInput()','script1(),script2()');
but neither have worked. I'm using a button to activate the above. I'm not sure what "oninput" is actually called, (Attribute? Element?).
ANSWER: I fixed it by using this syntax:
var s1g1 = document.getElementById("s1g1");
s1g1.setAttribute("oninput","calcGrades(),constraint()")
Will set both calcGrades() and constraint() when activated!