aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Switch display of tables using Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Switch display of tables using Javascript" Watch "Switch display of tables using Javascript" New topic
Author

Switch display of tables using Javascript

Mervin Chan
Greenhorn

Joined: Dec 03, 2004
Posts: 24
Simple Question:

I have two tables A,B on my Jsp page

I want to use javascript to, upon pressing a button, alternate between displaying table A or B. But not both at the same time.

ie.

Button pressed - Table A displayed.
Button pressed again - Table B displayed
.... A, B, A , ...


How do i do that?
[ October 06, 2005: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Use the display CSS attribute, alternating its value between 'block' (to show) and 'none' (to hide).
[ October 06, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Switch display of tables using Javascript
 
Similar Threads
Retrieving list of values from select box using javascript
JSP adn buttons
Problem with f:attribute tag, new to JSF
Messagebox
Passing parameters to the next action using html:button or html:submit