Skip to content
Advertisement

trigger onchange event for span not working

I am trying to trigger the onchange event on a span element. The event is not triggered at all. How can I make it happen? Here is my code:

First method I tried

JavaScript

Second method

JavaScript

Advertisement

Answer

the onchange event only works on inputs, selects and textareas. You will need another event.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement