<html>
<body>
<script language="JavaScript"> function function1() {
document.all.myP1.style.cssText = "color:green;";
}
</script>
<p id="myP1">Text Text Text Text Text Text Text Text </p>
<input type="button" value="Click to apply the style rules" onClick="function1();">
</body>
</html>