How to prevent event bubbling in javascript
问题 thanks for reading... I'll get right into the issue. I have an onclick function attached to an image. <div id="mercury" onclick="displayCreations()"> Javascript function: function displayCreations(){ document.getElementById("projects").style.display = "block"; } The div I'm displaying as a block is set to none once you arrive at the page. This function sets the display to block, which works . I'm having trouble with making an onclick function for an image inside the div that sets the display