<!DOCTYPE html>
<html>
<head>
<style>
#myDIV {
border: 1px solid black;
background-color: lightblue;
width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: visible;
}
</style>
</head>
<body>
<h1>Change text-overflow with JavaScript</h1>
<p>Click the "Try it" button to change the text-overflow property of the DIV element:</p>
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</div>
<script>
function myFunction() {
document.getElementById("myDIV").style.textOverflow = "ellipsis";
}
</script>
</body>
</html>