Monday, 15 May 2017

javascript - OnChange does not work on radio buttons

I do not know why the onchange function does not trigger if I Switch the Radio Buttons.



I only get the console message if I click on each Radio the first time, but after switching the Radio I do not the a console Output.



var drawingArrow = document.getElementById('drawing-arrow-shape'),

drawingCircle = document.getElementById('drawing-circle-shape'),

drawingCircle.onchange = function() {
console.log("on change circle btn");
};

drawingArrow.onchange = function() {
console.log("on change arrow btn");
};




No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...