As you mentioned in the comment, inside-context paragraphs will be just next to clicked anchor’s parent, this code will work:
$(".btn-context").on('click', function (event) {
event.preventDefault();
$('.inside-context').removeClass('open');
$(this).parent().next('p.inside-context').addClass('open');
});
Related Posts:
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- How to put JQuery/Ajax inside shortcode?
- Can someone please tell me what is wrong with my plugin?
- WordPress function not being called from jQuery method
- Create shortcode to echo javascript
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Load CSS files in header of Bones theme?
- JS working when used normally but not in wordpress
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Shortcode return is printing a 1 afterward
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- How to parse nested shortcodes?
- jQuery plugin only in one page/post
- change plugin shortcode function [closed]
- Dynamic HTML not displaying at respective place
- Plugin form unable to process
- Add jQuery to WordPress page
- How do I use WordPress PHP functions in my Javascript code?
- What’s the point of using WordPress’s built in admin-ajax.php?
- Short code for Venues
- Frontend editing, Frontend user dashboard
- jQuery Plugin to use WordPress functions in AJAX request
- Shortcode doesn’t work if I directly paste its function in a template file?
- Pass variable to nested shortcode
- Pass a php string to a javascript variable
- Problem in loading javascript in footer
- How to generate CSS from a shortcode within a plugin
- Using jquery migrate for plugins incompatible with jquery 1.10.2
- Prevent shortcode from being wrapped in tags
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Plugin Handle URL With Custom Theme
- Adding a slider captcha to the comment system
- Plugin for a text modal box [closed]
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- looking for navigation plugin (accordion) [closed]
- Trouble with editing template for “List category posts” plugin
- Time consuming callbacks in customizer
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- JQuery plugin that works with Google 1.10.2 and not with WordPress 1.10.2
- Loading a purchased jquery plugin in a wordpress theme
- Post Comments with Ajax in WordPress
- Integrating jQuery Datatables with Editor into wordpress admin
- Stop WordPress processing Javascript as text
- Use $_GET inside a shortcode print empty Array
- Render Modula Plugin Shortcode On Ajax Request
- Shortcode not getting replaced
- Shortcode Attributes to Return different $_POST
- How to change shortcode’s default theme?
- Get param from shortcode in plugin function
- Inserting shortcode in href – any ideas or workarounds?
- How can I achieve this, using shortcodes
- FancyBox JS stopped working on multiple sites. Custom plugin responsible. Urgent help needed
- jQuery(‘#news-ticker’).cycle is not a function
- Javascript from Easy-Fancybox place into footer
- WordPress plugin isn’t loading completely
- jQuery slider widget similar to cnet.com
- Elementor Pro display featured image on section -> style -> image using shortcode
- FacetWP breaks jQuery events
- WP Ajax DB issues
- jQuery Ajax not loading page with ACF fields
- Shortcode show error while editing post
- Get Shortcode output to database for static post_content
- Website always load twice on start
- Issue Saving Posts That Contain Shortcode
- Using Shortcode Result In Custom HTML Block (Using Google Sheet JQuery Result As NumScroller data-max)
- How to use plugin’s shortcode in custom design? [closed]
- Uncaught TypeError: Cannot read property ‘cycle’ of undefined
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- WP Plugin CSS not being applied to page
- Overwriting Plugin’s Ajax callback function from theme
- Multiple calling javascript from shortcode in one page
- Can’t find variable is_single in my jQuery plugin
- How to pass value to a plugins shortcode?
- Specific plugin script not working on subdomain
- Find all strings between an enclosing shortcode
- How to Add Jquery FullCalendar in wp plugin in admin
- Is there a function to search for a wildcard value when calling a shortcode?
- Plugin program: JQuery not working in this plugin
- Multiple level shortcodes
- Ajax, jQuery and WordPress
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- How to load a plugin when doing an Ajax call? [duplicate]
- jQuery loaded in wrong order for non-admin page views only
- Is it right way to create shortcode?
- PHP and Jquery pass value from form. Update function on DataBase
- Plugin use of ajax/jquery depending dropdown
- Creating Features List in WordPress Post
- Load css classes after using ajax calls
- How to resolve these findings from security audit
- Integrating WordPress Content into a jQuery Slider
- I am experiencing difficulty fulfilling client request
- Change page content based on dropdown selection
- Shortcode to do math with url variables
- How to get URL param for pagination in shortcode?
- Buffered output in chunks and shortcode – how do I achieve that?
- How to add an active state class to my info box