<html>
<head>
<style>
#myDIV {
background-color: coral;
color: white;
}
</style>
</head>
<body>
<h1>Change text-align with JavaScript</h1>
<p>Click the "Try it" button to right align the text of the DIV element:</p>
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
<h1>myDIV</h1>
</div>
<script>
function myFunction() {
document.getElementById("myDIV").style.textAlign = "right";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_js_text-align by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:24 GMT -->
</html>