Jump to content

How to make a word "appear" on button push.


chien_fu

Recommended Posts

I'm working on a flash card program in ASP and am still quite new to CSS and java, and am wondering if anyone has any suggestions that would help me accomplish this. When the page loads, there is a table with two columns, we'll call them the "question" and "answer" columns. Right now I've got it set up so that you can select whether to display the question or the answer, or both. I'd like there to be another button "show all" that displays all of the fields preferably without having to reload the page. Is there a good CSS, XHTML, or java way to accomplish this? Basically making a variable appear in the cell of a table at the push of a button?Thanks!

Link to comment
Share on other sites

You could do something like this: http://www.w3schools.com/js/tryit.asp?file...tryjs_function1Instead of having alert("HELLO"); you can replace that with:

document.getElementById('your_id_here').style.display = "block";

You can add in that code as many times as you like. That will grab your fields (given that you give them the right ID) and expand it. This is the easiest way I know.Edit: Just noticed that someone else answered this here.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...