I have a onclick function like this
onclick = function(){alert('hello')}
I want to add an additional function to it base on the server response so that I can display more, like not only display hello but also ‘you are welcome’, how to writ this without jquery?
onclick = function(){alert('you are welcome')}
thank you for helping.
Use
addEventListener.This is a modern way to do that.
For that old IE, you have to do this instead:
So a more convenience way to do that is