Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <script> function demoDisplay() { document.getElementById("p1").style.display="none"; } function demoVisibility() { document.getElementById("p2").style.visibility="hidden"; } </script> </head> <body> <p id="p1">This is some text.</p> <p id="p2">This is some text.</p> <input type="button" onclick="demoDisplay()" value="Hide text with display property"> <input type="button" onclick="demoVisibility()" value="Hide text with visibility property"> </body> </html>
Result:
W3Schools.com - Try it yourself