Creating onclick functions to test how i can make scripts to create interactive data. I made two functions activated by onclick events that directly edit the DOM elements of the html page
//attatch functions to onlick event for DOM elements
document.getElementById("btn_digital").onclick = content_digital;
document.getElementById("btn_studio").onclick = content_studio;
//create the functions for the onlick events
function content_digital() {
document.getElementById("content").innerHTML = "digital";
}
function content_studio() {
document.getElementById("content").innerHTML = "studio";
}




No comments:
Post a Comment