March 30, 201115 yr I'm doing a website project on FrontPage 03, which has a jeopardy game in it. I need a way to put tags in that would hide the answer till someone clicked it. I did a bit of googling already, but couldn't find anything good. I know you can do this with JavaScript, but I'd prefer to stay with just HTML. EDIT - Apparently you can't do this with HTML, so does anyone know how to do it in javascript?
March 30, 201115 yr You can't do it just with HTML unless you use hyperlinks and send the user to another page to see the answers.
March 30, 201115 yr Ignore this. :DThat uses javascript :P "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti
March 30, 201115 yr Javascript that modifies style properties works well The corp beast, is, well, just a corp beast. He doesnt even have any friends.[spoiler=Other Quotes]tbh idk why this makes me laugh so hardAll DFS threads turn into efficiency flame wars >.>>OP asks "why use DFS?">everyone says "there is no reason">someone says "stop bashing people who use DFS, efficiency troll ass clown">thread is now a flame fest
March 30, 201115 yr I wouldn't use Frontpage if I were you, puts in a lot of junk. I prefer using Notepad++, or Aptana Studio (free) if you like the auto-suggest feature.
March 31, 201115 yr Author I don't know HTML very well, so I'm using the split view so I can see the HTML build, but still see the final product and edit it like Word. I have no problem with using Javascript though, I just don't know how to implement it.
March 31, 201115 yr javascript.jsfunction toggleDisplayById(id) { var element = document.getElementById(id); if(element.style.display == "none") { element.style.display = "block"; } else { element.style.display = "none"; } } test.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript" src="javascript.js"></script> </head> <body> <button type="button" onclick="toggleDisplayById('aaaaaa')">Click Me!</button> <div id="aaaaaa"> <p>text</p> </div> </body> </html> Notes:#use css with style - display:none; for hiding on page load Edit:function modDisplayById(id, value) { var element = document.getElementById(id); if(element) { element.style.display = value; } } <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript" src="javascript.js"></script> </head> <body> <button type="button" onclick="modDisplayById('aaaaaa', 'block')">Show</button> <button type="button" onclick="modDisplayById('aaaaaa', 'none')">Hide</button> <div id="aaaaaa"> <p>text</p> </div> </body> </html>
Create an account or sign in to comment