Title: Run JavaScript function if a member is a certain level
Last modified: August 31, 2016

---

# Run JavaScript function if a member is a certain level

 *  Resolved [dchenko](https://wordpress.org/support/users/dchenko/)
 * (@dchenko)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/run-javascript-function-if-a-member-is-a-certain-level/)
 * I’d like to run a small JavaScript function showing an icon if a user is a Basic
   member and hiding it if the user is an Elite member. Is there a way to run this
   function onload of the page?
 * This is super important to me, so please help! Otherwise, the plugin is fantastic
   and I’ll gladly rate it at 5 stars.
 * Many thanks!
 * [https://wordpress.org/plugins/paid-memberships-pro/](https://wordpress.org/plugins/paid-memberships-pro/)

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

 *  Thread Starter [dchenko](https://wordpress.org/support/users/dchenko/)
 * (@dchenko)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/run-javascript-function-if-a-member-is-a-certain-level/#post-7282458)
 * Can someone help please?
 *  [wealthy](https://wordpress.org/support/users/wealthy/)
 * (@wealthy)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/run-javascript-function-if-a-member-is-a-certain-level/#post-7282460)
 * I believe this would require some extra coding which is really outside the scope
   of this forum.
 * You would need to ask within the PMPro forum area or get a coder to actually 
   code this for you.
 *  Plugin Author [Jason Coleman](https://wordpress.org/support/users/strangerstudios/)
 * (@strangerstudios)
 * [10 years ago](https://wordpress.org/support/topic/run-javascript-function-if-a-member-is-a-certain-level/#post-7282519)
 * RE running JavaScript for members only, here is an example of how to do that:
   
   [https://gist.github.com/strangerstudios/5b9b8e1de58d957c9a09](https://gist.github.com/strangerstudios/5b9b8e1de58d957c9a09)
 * Or here is an alternative way to show “member badges”:
    [https://github.com/strangerstudios/pmpro-member-badges](https://github.com/strangerstudios/pmpro-member-badges)

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

The topic ‘Run JavaScript function if a member is a certain level’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

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

 * 3 replies
 * 3 participants
 * Last reply from: [Jason Coleman](https://wordpress.org/support/users/strangerstudios/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/run-javascript-function-if-a-member-is-a-certain-level/#post-7282519)
 * Status: resolved