+ 3

How can I make text appear and disappear

For example if a condition is triggered it will print Score: 1 If its triggered again: Score: 2

13th Jun 2017, 10:22 PM
Complex
Complex - avatar
5 Respuestas
+ 11
html <div id='myDiv'>Some Text</div> js var myDiv=document.getElementById('myDiv'); to access the text simply use the innerHTML of the div: myDiv.innerHTML = 'different text'; this will change the text if you want to hide it however you can use myDiv.style.visibility = 'hidden'; or myDiv.style.visibility = 'visible'; https://www.w3schools.com/jsref/prop_style_visibility.asp or you can use the style.display myDiv.style.display = 'none'; check more valid options here: https://www.w3schools.com/jsref/prop_style_display.asp
13th Jun 2017, 10:34 PM
Burey
Burey - avatar
+ 7
no problems :)
14th Jun 2017, 7:11 AM
Burey
Burey - avatar
+ 3
@Burey Thanks :D
13th Jun 2017, 10:35 PM
Complex
Complex - avatar
+ 3
you can use blink tag in css
14th Jun 2017, 6:36 PM
Gautham J.M
Gautham J.M - avatar
+ 3
How can we prove if we want to appear the words slowly . For example when i click a door , after the door opened the words shows off. Can you help me please?
4th Jan 2021, 3:34 PM
Riselda Rada
Riselda Rada - avatar