<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function replaceButtonText(buttonId, text)
{
if (document.getElementById)
{
var button=document.getElementById(buttonId);
if (button)
{
if (button.childNodes[0])
{
//alert("ch");
button.childNodes[0].nodeValue=text;
}
else if (button.value)
{
//alert("val");
button.value=text;
}
else //if (button.innerHTML)
{
//alert("inner");
button.innerHTML=text;
}
}
}
}
//-->
</SCRIPT>
<title>button</title>
</head>
<body>
<a href="javascript:document.getElementById('myButton1').value='New Button Text';void(0);"><input type="button" value="Button Text" id="myButton1" onClick="javascript:replaceButtonText('myButton1', document.getElementById('button1Name').value);"></a>
</body>
</html>
|