This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes strike out text using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "strike out text using javascript" Watch "strike out text using javascript" New topic
Author

strike out text using javascript

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Is it possible to strike out text on a jsp page, on the click of a button?

Eg: I have some text "ABC ABC .." on a jsp page. I have a button - Strike out. On click of this button, I want the text "ABC ABC.." to be striked out. Is this possible using javascript?

Please help.


SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

A JSP is just an HTML page once it gets to the browser, so the JSP-ness of the page is moot.

In the button click event, you can change the CSS style of any element on the page under script control.

That should be enough information to get you started.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: strike out text using javascript
 
Similar Threads
JSF tags in Ajax response
Strike the value inside a text field
implementing the windows back button functionality
'&' missing while displaying Textbox values in JSP/jquery/javascript
How to display the timer in jsp page???