<input type=button value=button onclick="alert(this.value)">

解决方案 »

  1.   

    如果在其他所有对象的上下文之外使用this,则它指的是window对象。
      

  2.   

    Description
    Refers to the current object. 
    Syntax
    this.property
    Res
    The this keyword is typically used in object constructors to refer to the current object. In the following example, this refers to the newly created Car object, and assigns values to three properties: 
    function Car(color, make, model)
    {
      this.color = color;
      this.make = make;
      this.model = model;
    }For client versions of JScript, this refers to the window object if used outside of the context of any other object. 指向当前对象,默认情况下是指向window
      

  3.   

    this指对象本身。
    全局中(任何对象以外)指widnow对象。