On Fri, 02 Jan 2004 14:08:20 +0000, Ike wrote:
How can I make a textarea appear or disappear at the click of a button or
link?
Thanks, Ike
function hideElement( id )
{
var gebID = document.getElementById || document.all || NULL;
if( gebID )
gebID( id ).style.display = 'none';
}
function showElement( id )
{
var gebID = document.getElementById || document.all || NULL;
if( gebID )
gebID( id ).style.display = '';
}
....
<textarea id="foobar"></textarea>
<button onclick="showElement( 'foobar' );">Show Textarea</button>
<button onclick="hideElement( 'foobar' );">Hide Textarea</button>
..style.display = 'none'; makes the text area act exactly like a <input
type="hidden" />