Javascript DOM CSS Style textTransform Property get

Introduction

Return the text transformation of a <p> element:

alert(document.getElementById("myP").style.textTransform);

View 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>
<p id="demo"></p>
<script>
function myFunction() {/*from   ww  w.j  a v a 2s .co m*/
  document.getElementById("demo").innerHTML = document.getElementById("myP").style.textTransform;
}
</script>

</body>
</html>



PreviousNext

Related