Title: [Plugin: Tabbed Widgets] Can&#039;t use jquery to select tabbed widget elements
Last modified: August 19, 2016

---

# [Plugin: Tabbed Widgets] Can't use jquery to select tabbed widget elements

 *  Anonymous User
 * (@anonymized-6148869)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-tabbed-widgets-cant-use-jquery-to-select-tabbed-widget-elements/)
 * So I have the tabbed widget plugin loading and functioning correctly. I’m trying
   to use the following jquery code to just identify the number of ul’s in hopes
   of eventually adding some styling to li’s contained in there:
 *     ```
       jQuery(document).ready(function($){
       alert($('ul.tw-tabbed-nav').length + ' elements!');
           });
       ```
   
 * The problem is my script file that contains the above, loads before the plugin
   finishes setting up. I noticed that for a split second when my page loads the
   individual widgets are displaying individually before the tabbed widget loads
   them into tabs. Anyone know of a way to make sure the above function doesn’t 
   fire until after the plugins have finished loading? For the record, this is how
   my script file is being added to the site via my functions file:
 *     ```
       if ( !is_admin() ) { // instruction to only load if it is not the admin area
          // register your script location, dependencies and version
          wp_register_script('vtdscripts',
              get_bloginfo('stylesheet_directory') . '/js/vtdscripts.js',
              array('jquery'),
              '1.0', 1 );
          // enqueue the script
          wp_enqueue_script('vtdscripts');
       }
       ```
   
 * Thanks for the help all!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Kaspars](https://wordpress.org/support/users/kasparsd/)
 * (@kasparsd)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-tabbed-widgets-cant-use-jquery-to-select-tabbed-widget-elements/#post-2016346)
 * Try counting the number of widgets inside the tabbed widget:
 * `alert($('.tabbed-widget .widget').length + ' elements!');`
 * where .widget is the classname of your standard widgets.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Tabbed Widgets] Can't use jquery to select tabbed widget elements’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/tabbed-widgets.svg)
 * [Tabbed Widgets](https://wordpress.org/plugins/tabbed-widgets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tabbed-widgets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tabbed-widgets/)
 * [Active Topics](https://wordpress.org/support/plugin/tabbed-widgets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tabbed-widgets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tabbed-widgets/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Kaspars](https://wordpress.org/support/users/kasparsd/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-tabbed-widgets-cant-use-jquery-to-select-tabbed-widget-elements/#post-2016346)
 * Status: not resolved