以下为引用的内容:
function GetObject(Name)
{
var inputlist=document.all.tags('input');
var i=0;
for(i=0;i<inputlist.length;i++)
{
var input=inputlist[i];
if(input.id.indexOf(Name) !=-1)
{
return input;
}
}
return null;
}
function setEvent(Object,EventName,EventFunction)
{
if(Object ==null)
return;
if(window.addEventListener)
{
Mozilla, Netscape, Firefox
/addEventListener
Object.addEventListener(EventName.replace('on',''), EventFunction, false);
}
else
{
Object.attachEvent(EventName,EventFunction);
}
}
function blur()
{
var size=lSize.value * 0.3;
pSize.value=ForDight(size,0);
}
function ForDight(Dight,How)
{
var Dight = Math.round (Dight*Math.pow(10,How))/Math.pow(10,How);
return Dight;
}
var lSize=GetObject('STNumberTextBox1');
var pSize=GetObject('STNumberTextBox2');
setEvent(lSize,'onblur',blur);