English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i'm new to javascript programing, and i was wondering how to do stuff like when i click on an input button, a text box appears next to it and with another button i can hide it again. the basic principle i guess would be hiding or showing entire blocks of html. my question is, what kind of html tags that would allow that and how would i do it? or is there any other way to do it?

2007-03-10 07:21:36 · 3 answers · asked by Amr Hassan 2 in Computers & Internet Programming & Design

3 answers

Just use the following pattern:



Untitled Page


body>


Here is some test I want to show and Hide




2007-03-10 11:01:34 · answer #1 · answered by Smutty 6 · 1 1

here is some HTML




That is the basic principle. To get a little more useful, write a function:



Now, whenever you want to invoke the hiding, simply call:

hideElement('theElementIDtohide');

To show an element, set the style.display to an empty string:

style.display = '';

2007-03-10 15:36:34 · answer #2 · answered by Rex M 6 · 0 0

Put one block in one div and name the div something unique.
like


Your html


On any event of client side, you can use following in JavaScript
document.getElementById("divFirst").style.visibility = "hidden";
document.getElementById("divFirst").style.display = "none";

2007-03-11 06:06:21 · answer #3 · answered by Atif Majid 3 · 0 1

fedest.com, questions and answers