javascript - Changing the color of a text every 3 seconds in HTML -


i got code can explain me how works

var text = document.getelementbyid('film'); text.style.color = (text.style.color == 'red') ? 'white' : 'red'; 

it alternative of if-else loop. can seen too.

   if(text.style.color == 'red')        text.style.color = 'white';    else        text.style.color = 'red'; 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -