buttons HTML or ASP

hansari

New Member
Hey I just started programming my first website and I need help for a little project:)

I am trying to figure out a button fucntion. It has to function like this:

You start by seeing one button, when you click on the button it gives you 3 options and when you press for example button 1 it has to write a text. Clicking on button 2 it has to write a different text and etc.

Hope someone can help me and understands what I mean. Otherwhise please feel free to write me. I have attached a image of my description.
 

Attachments

  • Unavngivet.JPG
    Unavngivet.JPG
    10.3 KB · Views: 23

canyouseeme

New Member
You can use a javascript function to toggle the display of an element.

JAVASCRIPT
Code:
<script type="text/javascript">
    function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
</script>

BODY
Code:
<a href="#" onclick="toggle_visibility('theId');">Click Here</a>
<div id="theID">This is content will show/hide when you click the link</div>

Let me know how this works out for you, and if you need additional help, let me know.
 

Razorback64

New Member
For a form with an action you can use the <input type=image tag

<form action="youraction.php">
.
.
<input type="image" src="yourcoolimage.jpg">
</form>

For compatibility reasons do NOT add an onClick to an input type=image - instead use the onSubmit of the form if you want some javascript action
 
Last edited:
Top