<script language="JavaScript">
<!--function basetest(Tid)
{
  this.id = Tid
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='测试' onclick='"+ this.id +".GetName()'>");
}
}}
testObj=new basetest("testObj");
testObj.SetName("ggg");
testObj.ShowTable();/*
testObj2=new basetest();
testObj2.SetName("bbb");
testObj2.ShowTable();
*/
// 运行后点 测试提示 GetName返回  的是 PrevMonth ,怎么才能得到SetName的设定的值?
  //--></script>