I'm very new to using html and javascript. I want to add the ability to have the option to click on certain text and have the correct javascript execute. Are there any reference code I can look at, or a tutorial that can help me?
解决方案
for semantics I'd use a tag like this:
Clicky
to make the button look like normal text you can use css:
button.link { background:none;border:none; }
and for easiness of handing click I'd use jquery like so:
$(".link").click(function(){
//your JS here
});
but if you have an ID on the button you can use plain JS like this:
var button = document.getElementById("your-button-id");
button.onclick = function(){
//do stuff
}