til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Execute JavaScript from button

Make a button call a JavaScript function.

<input id="clickMe" type="button" value="clickme" onclick="doFunction();" />

And with parameters

<input id="clickMe" type="button" value="clickme" onclick="doFunction('Hello', 42);" />

Do note the use of single-quotes, which do not interfere with the double-quotes used in the HTML markup.

Resources and References