Hello everyone i have a google blog and we post many pages in my blog.

and we add a div like <div id='header'> .
the header div show all of the pages but i want to show my header only main page.
and hide all of other pages using a java script.
if anyone open my site 'www.myblogsite.blogspot.com/'
the <div id='header'> unhide
if the the visitor visit another page then hide <header>
please help.

3 Years
Discussion Span
Last Post by razamughal67

butt how to do this ?
we need a code.
please anybody give me the code
i am awaiting a good response


Text questions will most likely attract text answers. If you want code, then provide code.


No thank you. i do resolve it now.
We have solved the problem myself.

i am so happy because we join java language before one day.but i did that..
Where you could not helped us.there my God helped us .
Thanks God Thanks Alot.
But pritaeas and Airshow thanks for reply .


we share this code for who people was could not do this.
goto this site and check script online .

<!DOCTYPE html>
/*this is your div tag class. if you want to change div class you can change it */
color: violet;
/*End div tag class*/

<script stype="text/javascript">
var mysiteurl = location.host;
var newurl = 'www.w3schools.com';

if( newurl==mysiteurl ){
alert('url was match')
document.getElementById('demo').style.display = "show";
}else {
alert('url was not match')
document.getElementById('demo').style.display = "none";

<div id="demo">This my div tag value so we want to hide.</div>


Edited by razamughal67

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.