事件映射问题
klggg 2005-07-07 09:37:14 <script language="JavaScript">
<!--
function basetest()
{
this.name = null;
this.GetName = function()
{
alert(this.name);
}
this.SetName = function(value)
{
this.name=value;
}
this.ShowTable = function()
{
with (document)
{
write("<input type='button' name='PrevMonth' value='测试'>");
}
PrevMonth.onclick=this.GetName;
}
}
testObj=new basetest();
testObj.SetName("ggg");
testObj.ShowTable();
/*
testObj2=new basetest();
testObj2.SetName("bbb");
testObj2.ShowTable();
*/
// 运行后点 测试提示 GetName返回 的是 PrevMonth ,怎么才能得到SetName的设定的值?
//--></script>