You are here: irt.org | FAQ | JavaScript | DHTML | Q1674 [ previous next ]
Try:
<html>
<head>
<script language="JavaScript"><!--
function bold(id) {
if (document.getElementById) {
document.getElementById(id).style.fontWeight = 'bold';
}
else if (document.all) {
document.all[id].style.fontWeight = 'bold';
}
}
//--></script>
<p id="myPara">
some sample text <span id="mySpan">this bit will turn bold</span> but this won't.
</p>
<form>
<input type="button" value="bold" onClick="bold('mySpan')">
</form>
</body>
</html>