+ 1
Sometimes I see in the tag input an attribut like onclick how does it work? Where can I have the lists of events like onclick ??
Events
4 odpowiedzi
+ 2
A good introduction to events:
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events
+ 1
Adam if I want to write a function in js will the code above be appropriate ??
0
<span onclick="alert('hello');">Click</span>
would alert hello when you click it.
<span onclick="sayHello();">Click</span>
would run the function sayHello and execute whatever it contained.
here is a list of common events as they are called.
https://www.w3schools.com/js/js_events.asp
0
yes. those will work.