Urgent help please - Forum | JoomShaper
Awaiting an answer SP Page Builder

Urgent help please

Asked by Ghada Zoubi 3 years ago Last activity 3 years ago

Hello
I am using pop addon and I want to add a button on the source with this code :
<button onclick="copyText('https://kabsetzr.com');">Click here</button>

but the onclick removed !!
i tried to remove the script from the tinyeditor from the plugin from Prohibited Elements
but still remove it

please I need this as urgent issue can you reply to me as soon as possible ?

3 replies

Paul Frankowski Senior Staff
3 years ago · edited

Hi Ghada,

I can help you only remove custom code, not to add it. If Addon doesn't allow to use custom code, I cannot change it on forum. Support Policy!

Custom code should be added only as addon php code modification (or seprate file).
Just create addon clone, rename it, make customization inside site.php file.

‏‏‎ ‎J‏‏‎‎e‏‎‏‏‎‎n‏‏‎‎s W.‏‏‎

Hello Ghada,

you can try the following instead.
This way the attribute onclick is not needed.
CSS classes are not removed automatically.

The subsequent javascript would then have to be placed in the template's custom.js.
This code would then have to be placed in a DOMready.
If you still need help, please let me know.

let copyTextElements = document.querySelectorAll('.copyText');
for( let copyTextIndex in copyTextElements ) {
  if( copyTextElements.hasOwnProperty(copyTextIndex) ){
    copyTextElements[copyTextIndex].addEventListener('click',copyText);
  }
}

Have a nice day.

Ghada Zoubi Asked this

Thank you alot

Log in to reply.