I have created my own plugin which has a custom script attached to it. I have added this in the correct manor like this:
add_action('admin_enqueue_scripts', 'add_search_script');
function add_search_script() {
wp_register_script('search', plugins_url('search.js', __FILE__) );
wp_enqueue_script('search');
}
If i add an alert to the top of the .js file, and then refresh the plugin page the alert appears. Simple alert like this:
alert ('test');
However if i try and hide something with js, noting happens?
I target a class like this:
$(".simple").hide();
Which has no effect? I have also tried:
jQuery(".simple").hide();
Which again has no effect?
Any ideas on what could be the problem?