title: JQuery find element in script
body: <p>I am really not great at web stuff, so I am apologizing in advance for a potentially poor explanation of my problem.</p>
  
  <p>Basically, I have a webpage which utilizes the handlebars js templating. Unfortunately, this means that many of my div elements are contained within javascript tags like the following:</p>
  
  <pre><code>&lt;script type="text/x-handlebars" data-template-name="index"&gt;
           &lt;div class="row intro"&gt;
             ......
           &lt;/div&gt;
           &lt;div class="descript"&gt;           
             .....
          &lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>My intent is to grab one of these div elements using jquery.find(), but from what I understand, the html within the script tags is not treated as part of the dom...so jquery does not see it as a dom element. I was wondering if there is any other way I could go about this. Some more code is included.</p>
  
  <p>Here is another more explicit explanation in case the one I gave above was a little muddled: I am working on a personal website and would like to embed a project I have been working on in unity3d, but I need to add/remove elements based on whether or not the client has the unity3d web player installed. Normally I would get a particular element with</p>
  
  <pre><code>var $missingScreen = jQuery("#unityPlayer").find(".missing");
  </code></pre>
  
  <p>where 'missing' is simply an element inside unityPlayer which displays a link if the client does not have unity3d. I am also using some javascript templating to make my site look pretty and as a result, I have this problem:</p>
  
  <pre><code>&lt;script type="text/x-handlebars" data-template-name="index"&gt;
      &lt;div class="row intro"&gt;
          &lt;div class="intro-text"&gt;Hi, I'm *****&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="descript"&gt;           
          &lt;p&gt;
              Here's a Project I have been working on in case I am of interest to you:
          &lt;/p&gt;
      &lt;/div&gt;
  
      &lt;div class="content"&gt;
          &lt;div id="unityPlayer"&gt;
              &lt;div class="missing"&gt;
                  &lt;a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!"&gt;
                  &lt;img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" /&gt;
                  &lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;p class="footer"&gt;&amp;laquo; created with &lt;a href="http://unity3d.com/unity/" title="Go to unity3d.com"&gt;Unity&lt;/a&gt; &amp;raquo;&lt;/p&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>Jquery cannot access the missing element. Is there any way to do this? Thanks for any help you can give me and sorry again for my inexperience.</p>
  
  <p>EDIT* some people might want to know: here is how I determine whether or not to show the missing div. Another note; everything works fine if I remove the script tags...it is only when I put html within the script tags that it becomes inaccessible to jquery.</p>
  
  <pre><code>jQuery(function() {
                  var $missingScreen = jQuery("#unityPlayer").find(".missing");
                  $missingScreen.hide();
  
                  u.observeProgress(function (progress) {
                      switch(progress.pluginStatus) {
                          case "missing":
                              $missingScreen.find("a").click(function (e) {
                                  e.stopPropagation();
                                  e.preventDefault();
                                  u.installPlugin();
                                  return false;
                              });
                              $missingScreen.show();
                          break;
                          case "installed":
                              $missingScreen.remove();
                          break;
                          case "first":
                          break;
                      }
                  });
                  u.initPlugin(jQuery("#unityPlayer")[0], "temmp.unity3d");
              });
  </code></pre>