Return the text transformation of a <p> element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:textTransform

Description

Return the text transformation of a <p> element:

Demo Code

ResultView the demo in separate window

<!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() {//from w  w w  .  j ava 2s .  c  o  m
    console.log(document.getElementById("myP").style.textTransform);
}
</script>

</body>
</html>

Related Tutorials