I have a javascript problem where every time I change the color of an element.
Follow the code below:
<script type="text/javascript">
var timer = setInterval(modCor, 5000);
var cor = 0;
function modCor (){
if (cor==0){
var cor = 1;
var logoImg = document.getElementById('logo');
logoImg.style.border = "thick solid #00FF00";
}else if (cor == 1){
var cor = 0;
var logoImg = document.getElementById('logo');
logoImg.style.border = "thick solid #FF0000";
}
}
</script>
This is HTML:
<img src="empresa logo.jpg" class="Image_geral" id="logo">