I have an external javascript file where I wrote jquery code and javascript code but the javascript code isn't working. Only the alert is working.
I want some texts to flash different colors but it doesn't.
When I inspect elements using ctrl+shift+i I see the colors changing under inspect element, but it doesn't change in the webpage.
Something like it's running on the background or what I really don't know.
function flash() { var text = document.getElementById('sales'); text.style.color=(text.style.color=='red')? 'green' : 'red'; } var clr = setInterval(flash, 500)
<p id="sales"> <h3 style ="text-align: center; font-weight: bold;"> Flash Sales </h3></p>