I try at the moment to re-color a clicked link from purple back to black.
It works if I add following code directly into the html file:
<script language="javascript">
window.onload = function() {
document.getElementById("url").style.color = "#000000";
};
But I dont want to have that function in the HTML instead I put it into my .JS file. But it doesn't work.
function changeColor() {
document.getElementById("url").style.color = "#000000";
}
and then call it like this in the body:
<script>
changeColor(); //doesn't work
$(document).ready( function () {
changeColor(); //also doesn't work
});
</script>
Any idea what is wrong?