0
Question about my css
I have my CSS working but once I finished the JS when I hit the button to take in the inputs and then it goes to display the outputs it changes the background back to a white one instead of the colour, how can I fix this?
6 Respostas
+ 7
Replace document.write line with below code.
document.getElementById('demo').innerHTML = "Your change is "+totalq+" quarter(s),<br> "+totald+" dime(s),<br> "+totaln+" nickle(s),<br> "+totalp+" penny(ies).";
As document.write replaces your DOM completely.
+ 6
Almost, impossible to solve like this.
Please provide code playground link so that People here can help you out.
+ 6
Because you use document.write() method ^^ ( it overwrite your html content :P )
Use innerHTML property of the element you want to update instead ( as I explain in my last answer in a previous question thread you've posted ;) )
[ edit ]
The other thread:
https://www.sololearn.com/Discuss/347075/?ref=app
+ 1
can you show us your code? would be much more simpler to understand what you mean
0
oh yeah oops I thought I put the link in just a sec
https://code.sololearn.com/WWuH1Uln935H/?ref=app
0
awesome thanks 😂