Eric Roth Posted June 14, 2020 Share Posted June 14, 2020 Hello, Searched around but no luck...:-( In this countdown timer: https://www.w3schools.com/howto/howto_js_countdown.asp I try to get the seconds (not the "s") shown in red color. Could anyone point me to how to achieve that? Thanks, Eric Link to comment Share on other sites More sharing options...
dsonesuk Posted June 14, 2020 Share Posted June 14, 2020 Wrap in span with class, color that class name selector to red. Link to comment Share on other sites More sharing options...
ishan_shah Posted June 15, 2020 Share Posted June 15, 2020 You can use different class or p tag for 's' and provide color property Link to comment Share on other sites More sharing options...
dsonesuk Posted June 15, 2020 Share Posted June 15, 2020 So basically the 's' will break to a new line on its own because paragraph tag is a block element, then you want use property of color for 's' to change to red? Which is totally NOT! what the op asked for. Sorry i didn't provide the code for you to copy, like you usually do, but this just proves! You just don't have a clue without someone else providing the answer first. Link to comment Share on other sites More sharing options...
smus Posted June 16, 2020 Share Posted June 16, 2020 document.getElementById("demo").innerHTML = days + "d " + hours + "h " + minutes + "m <span style='color:red'>" + seconds + "</span>s " Link to comment Share on other sites More sharing options...
dsonesuk Posted June 16, 2020 Share Posted June 16, 2020 (edited) Now his twins will copy and paste with "Forgive my dada, hes been finding it very hard to prove himself lately, let me clarify how it should be done, as someone has, with gratitude, provided the answer. Expect the same answer shortly from my sibling also". Edited June 16, 2020 by dsonesuk Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now