• Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!

Question Adding jQuery to a page?

Edward

Edward

New Member
Hello. I'm learning Elementor & WordPress. How do I add the jQuery Ui according? I know there's already an accordion widget but I'm trying to learn how to use jQuery with Elementor & WordPress.

What I have done so far is:
  • added wp_enqueue_script( 'jquery-ui-accordion' ); to my functions.php
  • copied the sample html from jqueryui accordion page
  • pasted it into an Elementor Custom html widget
  • added to the bottom of the Custom HTML widget the jQuery snippet
JavaScript:
<script>
jQuery(document).ready(function( $ ) {
    $( "#accordion" ).accordion();
});
</script>

But when I view the page you can see jQuery code and the jQuery accordion does not display. Also I'm not seeing enqueued jQuery accordion script loaded as a source file. I searched for a couple of hours and can't find an answer. Confused???
 

Latest Resources

Other Elementor Resources

elementor official

Still stuck? Ask the forum

Post your question with a screenshot and a link if you can, and a member will usually reply within a day. Free to join, no sales pitch.

Create a free account
Top