Jump to content

Suggestions on making words "appear"?


chien_fu
 Share

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 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

Just to clearify and I'm not trying to be a jerk. (promise) :)Java? or JavaScript?Java...I can't help you. JavaScript, you can set the display property of each of the unique ID's as needed.For example, lets say you are working on your answer column. You can give it a unique id of "answer".Lets also say your button has a unique id of "display" then in java script:

var answer = document.getElementById('answer');var display_btn = document.getElementById('display');display.onclick = function() {  answer.style.display = 'block';}

To hide an object set the display to either 'hidden' or 'none'. Both have different results.That should help get you rolling...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...