Title: Cannot add JS onclick function
Last modified: February 17, 2025

---

# Cannot add JS onclick function

 *  Resolved [Aleks Smirnov](https://wordpress.org/support/users/fandc/)
 * (@fandc)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/cannot-add-js-onclick-function/)
 * Since v.14.15.7 I can’t add the following source code to “Tab Content” of the“
   Strictly Necessary Cookies” section.
 *     ```wp-block-code
       <p style="text-align: justify; display: block;">Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.</p><a href="#" onclick="showcookiedetailsFunction1()" id="showcookiedetails1">Show details</a><span id="showcookiedetailsplus1">+</span>
       ```
   
 * the onclick=”showcookiedetailsFunction1()” attribute of “a” tag is ignored and
   is not added to the target html page.
 * Is there a way to add the JS onclick function to “tab content” in new versions
   of your plugin?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcannot-add-js-onclick-function%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Support [Moove Support](https://wordpress.org/support/users/wpfrnd/)
 * (@wpfrnd)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/cannot-add-js-onclick-function/#post-18374570)
 * Hello,
 * Thanks for using our plugins.
 * Unfortunately this is not possible because we have to use the sanitize functions
   to keep security of our plugins high. For that reason, we’re not supporting any
   additional Javascript inside our plugin as attribute.
 * You may find our ‘Cookie Declaration’ feature relevant to your request – this
   is a premium feature however so if you have any questions related to that, you
   will have to reach out to our official support here (WordPress.org guidelines):
   
   [https://support.mooveagency.com/forum/gdpr-cookie-compliance/](https://support.mooveagency.com/forum/gdpr-cookie-compliance/)
 * Hope this helps.

Viewing 1 replies (of 1 total)

The topic ‘Cannot add JS onclick function’ is closed to new replies.

 * ![](https://ps.w.org/gdpr-cookie-compliance/assets/icon-256x256.png?rev=2376316)
 * [GDPR Cookie Compliance - Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law](https://wordpress.org/plugins/gdpr-cookie-compliance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gdpr-cookie-compliance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gdpr-cookie-compliance/)
 * [Active Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gdpr-cookie-compliance/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Moove Support](https://wordpress.org/support/users/wpfrnd/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/cannot-add-js-onclick-function/#post-18374570)
 * Status: resolved