title: Javascript not working in script tags?
body: <p>I need to know why it's doing this because I'm using the javascript in the script tags on my site and it's not working.</p>
  
  <p>Why does my javascript not work in the script tags (switch will not switch)
  <a href="http://jsfiddle.net/J7L4k/2/" rel="nofollow">http://jsfiddle.net/J7L4k/2/</a></p>
  
  <pre><code>&lt;link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"&gt;
  &lt;script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
      &lt;script&gt;
          $('.btn-toggle').click(function() {
      $(this).find('.btn').toggleClass('active');  
  
      if ($(this).find('.btn-primary').size()&gt;0) {
          $(this).find('.btn').toggleClass('btn-primary');
      }
      if ($(this).find('.btn-danger').size()&gt;0) {
          $(this).find('.btn').toggleClass('btn-danger');
      }
      if ($(this).find('.btn-success').size()&gt;0) {
          $(this).find('.btn').toggleClass('btn-success');
      }
      if ($(this).find('.btn-info').size()&gt;0) {
          $(this).find('.btn').toggleClass('btn-info');
      }
  
      $(this).find('.btn').toggleClass('btn-default');
  
  });
  
  $('form').submit(function(){
      alert($(this["options"]).val());
      return false;
  });
      &lt;/script&gt;
  
      &lt;h4&gt;Tiny&lt;/h4&gt;
    &lt;div class="btn-group btn-toggle"&gt; 
      &lt;button class="btn btn-xs btn-default"&gt;ON&lt;/button&gt;
      &lt;button class="btn btn-xs btn-primary active"&gt;OFF&lt;/button&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>However it works fine when the javascript is moved to JSFiddles javascript container?
  <a href="http://jsfiddle.net/udKj5/3/" rel="nofollow">http://jsfiddle.net/udKj5/3/</a></p>
  
  <p>thanks a lot.</p>