CSS Question

About DIVs (Hiding and Showing not Java)

<div id="abc" style="display: none;"><h1>abc</h1></div>


Hello! I hide the div but I want to see when I type it #abc I can't see this text.

Answer Source

Please find below sample as per your requirement.

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {

if(window.location.href.indexOf("#abc")!=-1)
{
    //alert("Page is loaded");
    document.getElementById("abc").style.display="block";
}
}
</script>
</head>
<body onload="myFunction()">

<h1>Hello World!</h1>


<div id="abc" style="display: none;"><h1>abc</h1></div>


</body>
</html>