Title: WordPress and Jquery
Last modified: August 26, 2019

---

# WordPress and Jquery

 *  [raul99t](https://wordpress.org/support/users/raul99t/)
 * (@raul99t)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-jquery-4/)
 * Hi,
 * I’m having trouble with my script, as i search on google, it seems that my code
   didn’t work due to jquery on wordpress.
 *     ```
       $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
   
               var href = $(e.target).attr('href');
               var $curr = $(".process-model  a[href='" + href + "']").parent();
   
               $('.process-model li').removeClass();
   
               $curr.addClass("active");
               $curr.prevAll().addClass("visited");
           });
       ```
   
 * This is what supposed to looks like:
    [https://codepen.io/rt99/pen/BaBWwRG](https://codepen.io/rt99/pen/BaBWwRG)
 * is there any solutions?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwordpress-and-jquery-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-jquery-4/#post-11867837)
 * The version of JQuery that ships with WordPress uses “no-conflict” mode. So, 
   in your code, `$` isn’t the shortcut for `jQuery`. You need to open with `jQuery('
   a[data-toggle="tab"]...`
 * [https://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/](https://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/)
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-jquery-4/#post-11867846)
 * WordPress loads jQuery in no-conflict mode, which means that the `$` is not defined.
   
   So not only do you need to load jQuery in you page when it is needed, you need
   to pass it into your function as `$` or code your function using `jQuery` instead.
 *  Thread Starter [raul99t](https://wordpress.org/support/users/raul99t/)
 * (@raul99t)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-jquery-4/#post-11873281)
 * sorry for late reply. I’ve changed $ to jQuery, and nothing changed.
 *     ```
       jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
   
               var href = jQuery(e.target).attr('href');
               var $curr = jQuery(".process-model  a[href='" + href + "']").parent();
   
               jQuery('.process-model li').removeClass();
   
               $curr.addClass("active");
               $curr.prevAll().addClass("visited");
           });
       ```
   
 * I’m quite new to this, might need some explanation.
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-jquery-4/#post-11876289)
 * We are only seeing a little bit of the whole picture here.
    Remember that you
   need to load your script into the page and you need to either load jQuery or 
   specify jQuery as a dependency on the `wp_enqueue_script` call you use to load
   it.

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

The topic ‘WordPress and Jquery’ is closed to new replies.

## Tags

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

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 3 participants
 * Last reply from: [Joy](https://wordpress.org/support/users/joyously/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-jquery-4/#post-11876289)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
