title: How do I use JQuery in my Wordpress plugin
body: <p>I have searched for an answer all over, but nothing has worked for me so far.</p>
  
  <p>I have tested the jQuery code outside of Wordpress and it seems to work, so I think I am having a problem registering or enqueuing the js file</p>
  
  <p>I want to use Jquery in a wordpress plugin I am writing. I tried to register and enqueue it with the following code:</p>
  
  <pre><code>function my_script() {
      wp_register_script('my_script', plugins_url('js/my_script.js', __FILE__), array('jquery'),'1.1', true);
      wp_enqueue_script('my_script');
  }
  
  add_action( 'wp_enqueue_scripts', 'my_script' );
  </code></pre>
  
  <p>But this for some reason is not working.</p>
  
  <p>The Jquery code I have:</p>
  
  <pre><code>$(document).ready(function(){
  
      $('.test').css("background-color", "red");
  
  });​
  </code></pre>
  
  <p>I also tried: <code>jQuery$(document).ready(function(){</code> and <code>jQuery(document).ready(function(){</code></p>
  
  <p>But nothing seems to work.</p>
  
  <p>EDIT: I went to see my source, and what I get is the follwing, which I don't know is correct as I am quite new to wordpress..</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://example.com/wp-content/plugins/my-plugin/same-hight.js?ver=1.1"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Please help.</p>
  
  <p>Thank you in advance for any answer.</p>