Question:

Javascript getElementById Help?

by  |  earlier

0 LIKES UnLike

Okay, i have my code.

<input type="button" value="Image 1" name="R1" onclick="document.getElementById('lulz')...

<input type="button" value="Image 2" name="R1" onclick="document.getElementById('lulz')...

<input type="button" value="Image 3" name="R1" onclick="document.getElementById('lulz')...

How do i make each button display a certain form, can i do that?

 Tags:

   Report

1 ANSWERS


  1. yup.

    &lt;input type=&quot;button&quot; onclick=&quot;displayForm(&#039;form1&#039;);&quot; ...

    &lt;script&gt;

    function displayForm(form) {

       document.getElementById(form).style.disp... = &#039;block&#039;;

    }

    &lt;/script&gt;

    &lt;form id=&#039;form1&#039; name=&#039;form1&#039; style=&#039;display: none&#039; ...

    When the button is clicked, the form&#039;s display property will change to block and it will be visible.

    ;)

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.