HTML DOM textDecoration Property
Complete Style Object Reference
Definition and Usage
The textDecoration property sets the decoration of a text.
Syntax
Object.style.textDecoration=none|underline
|overline|line-through|blink
|
Possible Values
Value |
Description |
none |
Defines a normal text |
underline |
Defines a line under the text |
overline |
Defines a line over the text |
line-through |
Defines a line through the text |
blink |
Defines a blinking text (does not work in IE and Opera) |
Example
The following example sets underline to a text:
<html>
<head>
<script type="text/javascript">
function setTextDecoration()
{
document.getElementById("p1").style.textDecoration="overline";
}
</script>
</head>
<body>
<p id="p1">This is an example paragraph.</p>
<input type="button" onclick="setTextDecoration()"
value="Set text-decoration" />
</body>
</html>
|
Try-It-Yourself Demos
textDecoration - Decorate a text
Complete Style Object Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|