Javascript event in widget
-
So in a text widget, I inserted a character, or an image. Then inserted a javascript event such as:
<a href="#" onclick="function_name()"><img class="alignnone size-full wp-image-696" src="https://domains/wp-content/uploads/2019/08/social-media.png" alt="social-media" width="10" height="20" /></a>
It works as expected. However, if I went to another area, then came back to this widget, open in text mode (not visual mode), then the onclick part disappeared already, only this left:
<a href="#"><img class="alignnone size-full wp-image-696" src="https://domains/wp-content/uploads/2019/08/social-media.png" alt="social-media" width="10" height="20" /></a>
Am I missing some setting to keep that?
Please advice. Thanks.
- The topic ‘Javascript event in widget’ is closed to new replies.