Difference between revisions of "Template:Toronto/js/test-script"

(Created page with "'use strict' document.getElementById('testbutton').on('click', () => alert('You clicked the button! Now go do something with your life.'))")
 
Line 1: Line 1:
 
'use strict'
 
'use strict'
  
document.getElementById('testbutton').on('click', () => alert('You clicked the button! Now go do something with your life.'))
+
document.getElementById('testbutton').addEventListener('click', clickHandler)
 +
 
 +
const clickHandler = () => alert('You clicked the button! Now go do something with your life.')

Revision as of 14:18, 15 September 2016

'use strict'

document.getElementById('testbutton').addEventListener('click', clickHandler)

const clickHandler = () => alert('You clicked the button! Now go do something with your life.')