title: How to use jQuery in JSF?
body: <p>Hi I'm new to JSF and jQuery .
  Do I need to download any jQuery jar and pack to war in order to use?
  Because in my code I can't call the jquery function.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"&gt;
  
    &lt;h:head&gt;
     &lt;script type="text/javascript" src="js/jquery-1.7.1.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript" src="js/06.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
  
    $(document).ready(function() {
  
        $("#form\\:name").click(function() {
           alert("hii");
        });
     });
   &lt;/script&gt;
  
   &lt;/h:head&gt;
   &lt;h:body&gt;
      &lt;h:form id="form"&gt;
        &lt;h:outputText id="hi" value="hi guys"&gt;&lt;/h:outputText&gt;
        &lt;input id="name" /&gt;
      &lt;/h:form&gt;
   &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This alert doesn't popup when I click on the output box.</p>
  
  <p>In my pom I use this dependency.   </p>
  
  <pre><code>&lt;dependency&gt;
     &lt;groupId&gt;com.efsavage.jquery&lt;/groupId&gt;
     &lt;artifactId&gt;jquery-maven&lt;/artifactId&gt;
     &lt;version&gt;1.7.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>