JS code inside Pagebuilder strips
Hello, dear users! Can you help me to sort out with the js code I wrote inside PB. On clicking button there will be apperance of a modal window. Does this js code “onclick” work if you add it inside pagebuilder code strips at the php file?
$output .= '<a href="#" onclick="document.getElementById("btn-1508746468").style.display="block"" id="btn-1508746468" class="sppb-btn sppb-btn-primary sppb-btn-rounded sp-tooltip" data-toggle="tooltip" data-placement="top" data-original-title="Кнопка временно не работает, приносим свои извенения. Для заказа, звоните: +7 (926) 962-42-21 | +7 (926) 493-51-99"><i class="fa fa-shopping-cart"></i>ОФОРМИТЬ ДОСТАВКУ</a>';$output .= '<div id="btn-1508746468" class="w3-modal">
<div class="w3-modal-content w3-card-4">
<header class="w3-container w3-teal">
<span onclick="document.getElementById("btn-1508746468").style.display="none""
class="w3-button w3-display-topright">×</span>
<h2>Modal Header</h2>
</header>
<div class="w3-container">
You have two options to close this modal:
Click on the "x" or click anywhere outside of the modal!
</div>
<footer class="w3-container w3-teal">
Modal Footer
</footer>
</div>
</div>';This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
1Hi Olga,
I would add the provided code to a Custom HTML widget.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.