<html>
<head>
<script>
function displayResult()
{
document.getElementById("p1").style.maxWidth="150px";
}
</script>
</head>
<body>
<p style="background:red;" id="p1">This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p>
<input type="button" onclick="displayResult()" value="Set max width">
</body>
</html>