question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code Plugin - button onclick code not updating content

See original GitHub issue

I have the tinymce editor working on my site, and except for this bug I’ve found, it works perfectly. I’m not sure if it’s a known issue, but I don’t seem to be able to update the source code content of the tinymce dialog. I have the ‘code’ plugin active and my source code is as below: <button class="btn-xs btn-success">Click me to see a GIF of the process</button><img id="integration_gif" class="hideme" style="width: 100%; height: 100%;" src="../uploads/system/images/integration.gif">

I need to add an onclick functionality here in the button as follows: <button class="btn-xs btn-success" onclick="toggle('integration_gif');">Click me to see a GIF of the process</button><img id="integration_gif" class="hideme" style="width: 100%; height: 100%;" src="../uploads/system/images/integration.gif">

For whatever reason, when I add the onclick event in the button tag (or anywhere else for that matter), it reverts when I click save. However, if I update the information inside the class of the button, that does work.

Any able to shed any light on this problem for me? Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Paytah232commented, May 23, 2022

Fantastic. Well this solved my issue. Thanks so much for your help and a great tool!

0reactions
TheSpydercommented, May 23, 2022

The schema is too big to keep a copy of it in the documentation - you’ll have to look at the code: https://github.com/tinymce/tinymce/blob/731754d6019938fd74d4d8c233423d3fcdb1148c/modules/tinymce/src/core/main/ts/api/html/Schema.ts#L263-L264

I don’t think we do any validation on attribute values, only whether attributes are allowed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript Button onClick not working in Chrome extension ...
The code for the button reads <button class="ui fluid red button" onclick=toggleActive() id="toggle">Toggle Active</button> , and toggleActive() ...
Read more >
Update Button Does Not Work - WordPress.org
It does not show any error when I click it, it just does not work. This issue has never happened before. Why does...
Read more >
WordPress Changes Not Showing? 3 Methods to Fix It Right ...
How to Fix Your WordPress Site Not Updating. 1. Force Refresh Your Browser; 2. Clear Your WordPress Cache Using a Caching Plugin; 3....
Read more >
WordPress Changes Not Showing? Here's How to Fix ... - Kinsta
How to Fix WordPress Site Not Updating Issues ... Then, go to the Tools tab and click the Clear cache button under Site...
Read more >
How to Use the Button Widget in Elementor
The Button Widget helps you easily design and customize buttons without the need ... jQuery('#My_Button a').click(function(){ // tracking code here // for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found