samedi 17 février 2018

jQuery event methods VS. HTML event attributes

HTML event attributes:

<button id="myButton" onclick="someFunction()">Click me</button>

jQuery event methods:

$('#myButton').click(function () { alert('Hello'); });

Which way is better?




Aucun commentaire:

Enregistrer un commentaire