"FantaJ" <vi*********@gm ail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hi,
Is it possible to make a html button invisible using javascript?
I can certainly disable it:
var x=document.getE lementById('but ton2');
x.disabled=true ;
//x.type = 'hidden'; // read only?
//x.visible = false; // doesn't exist?
but is there a property i can (ab)use to make it invisible?
Thanks in advance.
<button id="myButton">M y Button</button>
<button onclick="toggle Visibility('myB utton');">Hide/show My
Button</button>
<button onclick="toggle Display('myButt on');">Remove/restore My
Button</button>
<script type="text/javascript">
function toggleDisplay(i d) {
var el;
if (document.getEl ementById) {
el = document.getEle mentById(id);
} else if (document.all) {
el = document.all[id];
}
if (el && (el = el.style) && ('string' == typeof el.display)) {
el.display = ('none' == el.display ? '' : 'none');
}
}
function toggleVisibilit y(id) {
var el;
if (document.getEl ementById) {
el = document.getEle mentById(id);
} else if (document.all) {
el = document.all[id];
}
if (el && (el = el.style) && ('string' == typeof el.visibility)) {
el.visibility = ('hidden' == el.visibility ? 'visible' :
'hidden');
}
}
</script>
--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ -
http://jibbering.com/faq