I'm very new to Javascript and this is my first time creating my own function. I'm trying to change the color of links based on whether or not the user clicks a button I've created. The code is as follows:
<p align="center">
<input type="button";
onclick="changelinks"
value = "Click this if you can't see the links!"/>
</p>
This is the code I have for my function.
<script type="text/javascript">
function changelinks(links) {
var element = document.getElementByClass("links");
element.onclick.color = "#00FF7F";
}
</script>
Do you have any suggestions to make my function work? How can I link my function to the button? Thanks in advance, I really appreciate it.