title: How to add a java script handler for button click event in odoo 10?
body: <p>I want to make a handler for button in header using java script.  My view model is given below :</p>
  
  <pre><code>     &lt;template id="assets_backend" name="petstore" 
          inherit_id="web.assets_backend"&gt;
          &lt;xpath expr="." position="inside"&gt;
  
       &lt;script type="text/javascript" 
          src="/mypetstore/static/src/js/model_access.js"&gt;
       &lt;/script&gt;
  
       &lt;link href="/mypetstore/static/src/css/petstore.css" 
           rel="stylesheet"&gt;
       &lt;/link&gt;
          &lt;/xpath&gt;
      &lt;/template&gt; 
  
  
  
      &lt;record model="ir.ui.view" id="my_pet_store_form"&gt;
          &lt;field name="name"&gt;my_pet_store_form&lt;/field&gt;
          &lt;field name="model"&gt;petstore.message&lt;/field&gt;
          &lt;field name="type"&gt;form&lt;/field&gt;
          &lt;field name="arch" type="xml"&gt;
          &lt;header&gt;
           &lt;button name="click_me" string="Click" 
                class="oe_highlight"/&gt;
           &lt;/header&gt;
              &lt;form string="Message of the day"&gt;
  
                  &lt;group col="2"&gt;
                      &lt;group&gt;
                          &lt;field name="data"/&gt;
                      &lt;/group&gt;
                  &lt;/group&gt;
              &lt;/form&gt;
            &lt;/field&gt;
         &lt;/record&gt;
  </code></pre>
  
  <p>When user click on 'click_me' button, then it call a simple javascript function or action client. Just print an alert.
         JS part :
         odoo.define('mypetstore.model_access', function (require) {
          "use strict";
          var Class = require('web.Class');
          var Widget = require('web.Widget');
          var core = require('web.core');
          var utils = require('web.utils');</p>
  
  <pre><code>    jq('#click_me').bind('click', function(){
         alert("hello");
        });  
      });
  </code></pre>