HTML DOM textTransform Property
Complete Style Object Reference
Definition and Usage
The textTransform property sets capitalization effect on a text.
Syntax
Object.style.textTransform=none|capitalize|uppercase|lowercase
|
Possible Values
Value |
Description |
none |
Default. No characters are converted |
capitalize |
The first character of each word is converted to uppercase |
uppercase |
All characters are converted to uppercase |
lowercase |
All characters are converted to lowercase |
Example
The following example converts first letter of each word to uppercase:
<html>
<head>
<script type="text/javascript">
function changeText()
{
document.getElementById("p1").style.textTransform="capitalize";
}
</script>
</head>
<body>
<p id="p1">This is an example paragraph.</p>
<input type="button" onclick="changeText()"
value="Convert first letter of each word" />
</body>
</html>
|
Try-It-Yourself Demos
textTransform - Convert text
Complete Style Object Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|