Urgent Help Please - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

Urgent Help Please

GZ

Ghada Zoubi

SP Page Builder 2 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 ?

0
3 Answers
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 2 years ago #105067

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.

0
‏‏‎ ‎J‏‏‎‎e‏‎‏‏‎‎n‏‏‎‎s W.‏‏‎
‏‏‎ ‎J‏‏‎‎e‏‎‏‏‎‎n‏‏‎‎s W.‏‏‎
Accepted Answer
2 years ago #105358

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.

0
GZ
Ghada Zoubi
Accepted Answer
2 years ago #105456

Thank you alot

0