Title: jQuery within the plugin
Last modified: August 20, 2016

---

# jQuery within the plugin

 *  Resolved [cultureclash](https://wordpress.org/support/users/cultureclash/)
 * (@cultureclash)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jquery-within-the-plugin/)
 * Hey Mordauk!
 * Thanks for the great plugin! It’s very useful. But I have a problem and after
   hours of trying I’m not able to find a solution for it.
    I want to implement 
   a link in the restricted message which scrolls the whole page to the top (there’s
   the login form) Therefore I have written a script.js file (in my template folder)
   with the following content:
 *  jQuery(“#loginalert”).slideDown(“fast”);
    jQuery(‘#loginalert’).click(function(){
   jQuery(‘html,body’).animate({scrollTop: 0}, 1000); });
 * If I put the A HREF Tag (`<a href="#" id="loginalert">Scroll up to login</a>`)
   into a wordpress post, everything works fine as it should.
    But if I try to use
   it in the plugin it doesn’t work. Even if i put the A HREF Tag in the shortcodes.
   php directly nothing is happening. (`return ‘<span style=”color: red;”>’ . str_replace(‘{
   userlevel}’, $userlevel, $rc_options[‘shortcode_message’]) .'</span><a href=”#”
   id=”loginalert”>Scroll up to login</a>’; }` )
 * Maybe you can give me a hint. I would appreciate it a lot cause I’m not a good
   coder at all :/
 * [http://wordpress.org/extend/plugins/restrict-content/](http://wordpress.org/extend/plugins/restrict-content/)

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

 *  Thread Starter [cultureclash](https://wordpress.org/support/users/cultureclash/)
 * (@cultureclash)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jquery-within-the-plugin/#post-3470916)
 * I’ve found the mistake now on my own but I can’t reconstruct it. 😛 Thanks anyway!
   It’s really a great plugin!
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/jquery-within-the-plugin/#post-3470952)
 * Great!

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

The topic ‘jQuery within the plugin’ is closed to new replies.

 * ![](https://ps.w.org/restrict-content/assets/icon.svg?rev=3529325)
 * [Membership Plugin - Kadence Memberships](https://wordpress.org/plugins/restrict-content/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-content/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-content/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-content/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-content/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-content/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/jquery-within-the-plugin/#post-3470952)
 * Status: resolved