- Change your a tag with this. I fixed some typo.
<a class="button" onclick="OnOff()">On/Off</a>
2)Add this class in your css file
.change-color {
fill: #000000;
}
- Finally change your script like this :)
<script>
function OnOff() {
var element = document.getElementById("Tracciato_1")
element.classList.toggle("change-color");
}
</script>
if you will have a question you can ask .
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…