title: row click event in dynamic created table return undefined error?
body: <p>I use below code to create a table and add row click event which returned the value of first td in it.  </p>
  
  <pre><code>function bclick(){
      var result=[];
      SAPget.step4QueryTable(function(data){
      var tbody=document.querySelector("tbody");
           for(var i=0;i&lt;data.length;i++)  
              {
                  var tr=document.createElement("tr");
                  tbody.appendChild(tr);
                  var td=document.createElement("td");  
                  tr.appendChild(td);
                  td.innerHTML=data[i].code; 
                  var td1=document.createElement("td");
                  tr.appendChild(td1);                
                  if (data[i].name!="")
                      { 
                          td1.innerHTML=data[i].name; 
                      }
                  else
                      { 
                          td1.innerHTML="";    
                      }
                  tr.onclick=function fun(){
  
                      alert(this.children("td:first"));
                      }  
  
              }
  
          }
      )
  }
  </code></pre>
  
  <p>But it always alert undefined. I debug it in IE and the children has length 2 but value is empty.Can someone tell me what's wrong?  Thx.</p>