hello,I;'m trying to hide a DIV element without any success pls see if i got something here wrong because i just cant see it. 10x. <script type="text/javascript"> var P = document.getElementById('Funk'); P.style.display='none'; </script> Code (markup): the div i'm trying to reace is this: <div id="Funk"> <p> HelloWorld </p> HTML:
Hi progfrog, Nothing seems to be wrong with your code. May be you should include it in a function and call it on button click or onLoad event. Also check whether you have closed the div properly. Hope this helps.
Well, if your script executed before the <div> element loaded, it won't work. You can try to wrap your code in a function, as Unni krishnan said: <script type="text/javascript"> function hideDIV() { var P = document.getElementById('Funk'); P.style.display='none'; } </script> HTML: Put this between <head> and </head>. Then call this function after your <div> loaded.