Javascript examples for CSS Style Property:textTransform
The textTransform property sets or gets the capitalization of a text, for example, uppercase, lowercase or to capitalized.
Value | Description |
---|---|
none | No characters are transformed. This is default |
capitalize | The first character of each word is transformed to uppercase |
uppercase | transformed to uppercase |
lowercase | transformed to lowercase |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | none |
Return Value: | A String, representing the transformation of the text in the element |
CSS Version | CSS1 |
Transform the first letter of each word in a <p> element to uppercase:
<!DOCTYPE html> <html> <body> <p id="myP" style="text-transform:lowercase;">This Is An Example PARAGRAPH.</p> <button type="button" onclick="myFunction()">Return text transformation of p</button> <script> function myFunction() {/* w w w. j a va 2 s .c om*/ document.getElementById("myP").style.textTransform = 'uppercase'; } </script> </body> </html>