Wednesday, 18 September 2013

function triggers on click

function triggers on click

How do I trigger this function:
<script>
function change(x) {
var target = document.getElementById("target");
if (y == "imgA") {target.className = "cast1";}
else if (y == "imgB") {target.className = "cast2";}
else if (y == "imgC") {target.className = "cast3";}
else if (y == "imgD") {target.className = "cast4";}
else {target.className = "chart";}
}
function changeReset() {
var target = document.getElementById("target");
target.className = "chart";
}
</script>
To only happen when this button is pressed?
<div class='nfooter' style="position:float;"><a id="c_question"
href="#"><img src="../name_footer/_name.png" /></a></div>

No comments:

Post a Comment