<< Index

Onclick Event

Page | Source
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>   
    <title>XQIB: Sample page</title>
    <meta charset="UTF-8"/>
    <script type="text/javascript" src="mxqueryjs/mxqueryjs.nocache.js"></script>
    <script type="application/xquery">
      declare sequential function local:listener($loc, $evtObj) {
        b:alert("Hello, World")
      };

      b:addEventListener
        (b:dom()//input[@id="myButton"], "onclick", local:listener#2)
    </script>
  </head>
  <body>
    <h1>Onclick Event</h1>
    <input id="myButton" type="button" value="Click me"/>
  </body>
</html>