Forum Moderators: open
This is the most direct method, and works with IE5+ and NS6, but not with NN4.x nor Opera.
<html>
<head>
<script type='text/javascript'>
function changeP() {
document.getElementById('p1').innerHTML = "This is the <b>new</b> content for <i>my paragraph</i>.";
}
</script>
</head>
<body>
<form onsubmit='return false'>
<input type='button' value='Click Me' onclick='changeP()'>
</form>
<p id='p1'>This is my paragraph</p>
</body>
</html>