Hello Everyone
i am new in java language. and iwant to hide any <div> tag on my site
site example: 'www.mysite.com'
and i have a div in my website. like <div id='header'>

when we load my site the java script run and check my site url.
'www.mysite.com' if the url is correct then my <div id='header'> show in my site
else if the url is not match with the java variable var'www.mysite.com'
then hide

Please help

razamughal67:
you seem to be mistaken. what you are asking, is JavaScript, not Java. even though the names seem alike, they are not even remotely related. One is a scripting language, the other is a platform independent programming language.

anyway, it is fairly easy to manipulate the css scheme for an element (or tag).
just add a class to your div (or, using an id, it should be possible just as well), and if the urls don't match, set the visibility value to false.

remember: you don't really "remove" the tag, as much as you hide it.

for future reference though, JavaScript questions should better be asked in the Javascript forum

stultuske
Thanks for reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.