title: How to use JavaScript with CHtml button() on a Yii page
body: <p>I'm trying to use JavaScript in my page. My JavaScript code is:</p>
  
  <pre><code>function edit(){
    alert("test"); 
    return document.getElementById("confirm").value="";
  }
  </code></pre>
  
  <p>Calling this, by <code>onclick</code> function</p>
  
  <pre><code>&lt;?php echo CHtml::button("Edit",array('title'=&gt;"Edit",'onclick'=&gt;'js:edit();')); ?&gt;
  </code></pre>
  
  <p>both where in same page and confirmation.php</p>