I want to have all input elements on my page trigger a function when they change. Can I do it from a CSS?
I tried this:
<STYLE type="text/css">
input {onChange: function() {alert("foo");};}
</STYLE>
It didn't work in Google Chrome.
CSS doesn't provide eventing. If this is what you want, then I would write a JavaScript function that runs when the page loads. In the function, traverse the form elements for everything that has the tagName input. For each of those, add an event handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With