Title: Running jquery inside plugin admin page
Last modified: August 21, 2016

---

# Running jquery inside plugin admin page

 *  Resolved [Snaphaan](https://wordpress.org/support/users/snaphaan/)
 * (@snaphaan)
 * [12 years ago](https://wordpress.org/support/topic/running-jquery-inside-plugin-admin-page/)
 * This is a simple piece of jqeury I have picked up from JSFiddle:
 *     ```
       $('.sample').on('click', function () {
   
           console.log(this);
           var choice = $(this);
   
           if (choice.is(":checked")) {
               $('#choices').append(choice.val() + " is checked!");
           }
       });
       ```
   
 * Here is the html:
 *     ```
       <div id="top-menu">
           <input type="checkbox" class="sample" value="a">A</input>
           <input type="checkbox" class="sample" value="b">B</input>
           <input type="checkbox" class="sample" value="c">C</input>
       </div>
       <label>Choices</label>
       <div id="choices"></div>
       ```
   
 * And this is how I enqued jquery in my functions.php:
 *     ```
       function load_jquery() {
           wp_enqueue_script( 'jquery' );
       }
       add_action( 'wp_enqueue_script', 'load_jquery' );
       ```
   
 * But nothing works! I’v tried a number of other simple scripts for instance:
 *     ```
       jQuery(document).ready(function(){
   
           alert("Hello");
       });
       ```
   
 * .. and still nothing.
 * Any help would be greatly appreciated.
 * Thank you

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years ago](https://wordpress.org/support/topic/running-jquery-inside-plugin-admin-page/#post-4922147)
 * To enqueue scripts for admin pages, you must hook ‘admin_enqueue_scripts’, not‘
   wp_enqueue_scripts’, that is only for front end pages.
 *  Thread Starter [Snaphaan](https://wordpress.org/support/users/snaphaan/)
 * (@snaphaan)
 * [12 years ago](https://wordpress.org/support/topic/running-jquery-inside-plugin-admin-page/#post-4922185)
 * Thanks a million for your response!!!
 * I’ve kinda found a work around enqueuing the script but it is… was not ideal.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Running jquery inside plugin admin page’ is closed to new replies.

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [plugin admin](https://wordpress.org/support/topic-tag/plugin-admin/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [Snaphaan](https://wordpress.org/support/users/snaphaan/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/running-jquery-inside-plugin-admin-page/#post-4922185)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
