The correct way to add a JavaScript in Widgets

I’m new to WordPress, and I’ve developed a code to load an iframe after a click in a button with some styles. But it is breaking the template’s layout, and I’d like to know the correct way to add my funcions to the template.

<a id=”fazer_pedido” href=”” onclick=”document.getElementById(‘load-chat’); = ‘default’; = ‘0.1’;
document.getElementById(‘load-chat’).height = ‘400px’;
document.getElementById(‘load-chat’).style.boxShadow = ‘0px 3px 15px #e4e4e4’;
document.getElementById(‘load-chat’).style.borderRadius = ’15px’;” target=”load-chat”>Load the iframe</a>

<iframe frameborder=”0″ id=”load-chat” name=”load-chat” scrolling=”0″ style=”overflow:hidden” width=”100%”/>

Please describe as detailed as possible.

Read more here:: The correct way to add a JavaScript in Widgets

Leave a Reply

Your email address will not be published. Required fields are marked *