title: javascript onclick not firing on button click
body: <p>I am trying to call a JS function when the user clicks a button. But the onclick event is not being fired. The developer tools shows me the following error:</p>
  
  <p>Error executing: </p>
  
  <pre><code> function (/*Event*/ e){
          // summary:
          //      Handler when the user activates the button portion.
          if(this._onClick(e) === false){ // returning nothing is same as true
              e.preventDefault(); // needed for checkbox
          }else if(this.type == "submit" &amp;&amp; !this.focusNode.form){ // see if a nonform widget needs to be signalled
              for(var node=this.domNode; node.parentNode/*#5935*/; node=node.parentNode){
                  var widget=dijit.byNode(node);
                  if(widget &amp;&amp; typeof widget._onSubmit == "function"){
                      widget._onSubmit(e);
                      break;
                  }
              }
          }
      } 
  ReferenceError
  arguments: Array[1]
  get message: function () { [native code] }
  get stack: function () { [native code] }
  set message: function () { [native code] }
  set stack: function () { [native code] }
  type: "not_defined"
  __proto__: Error
  </code></pre>
  
  <p>Here is my code:</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;td&gt;
  &lt;button dojoType = "xwt.widget.form.TextButton" id = "pingButton" baseClass = "defaultButton" onclick = "onPing();"&gt;Ping
    &lt;/button&gt;
     &lt;/td&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>onPing : function() {
          alert('works');
      }
  </code></pre>
  
  <p>Any suggestions on what to do?</p>