title: Jquery click function, using this but return me window object
body: <p>all. I have html layout like this:</p>
  
  <pre><code>&lt;div class="row" id="1"&gt;
  /*Other code has nothing to do with &lt;div class="form-group col-lg-1"&gt;*/
  
     &lt;div class="form-group col-lg-1"&gt;
           &lt;input type="button" class="btn btn-default" onclick="updateLine()" value="Update"&gt;
     &lt;/div&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to obtain the div's ID, in this case, which is 1.</p>
  
  <p>This is what I did.</p>
  
  <pre><code>function updateLine() {
    alert(this.parent().parent().attr("id"));
  }
  </code></pre>
  
  <p>However, it failed, then I check </p>
  
  <pre><code>alert(this);
  </code></pre>
  
  <p>it returns to me the window object.</p>
  
  <p>So the question is , how could I get the id's value, which is 1.</p>
  
  <p>Thanks.</p>