magix wrote on 15 mrt 2007 in comp.lang.javascript
:
Hi,
How can I used <DIVtag to display or hide certain code in html from
javascript point of view ?
Javascript has no views ;-)
<body onload="DisabledForm()" ...>
The piece of code that I want to hide is like
<Img src="somepicture.jpg"><a ...></a>
<input type="hidden" ...>
<input type="hidden" ...>
So in javascript DisabledForm( ), how can I hide/display the above
piece of code ? using DIV ? or any better suggestion.
better start off with CSS display-none:
<body>
<form name='myForm' style='display:none;'>
<img src="somepicture.jpg"><a ...></a>
<input type="hidden" ...>
<input type="hidden" ...>
</form>
but you could also:
function hideForm(){
document.forms['myForm'].style.display='none';
}
function showForm(){
document.forms['myForm'].style.display='block';
}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)