dynamically added html to code strange behaviour
See original GitHub issueHi there,
I want to add an html text to summernote which i got from ajax.
The string is like <span style="font-weight: bold;">test</span> test
.
If I add it like this:
$('#product_description_'+lang).code('<span style="font-weight: bold;">test</span> test');
it comments the closing span and adds a closing span to the end.
<span style="font-weight: bold;"> test <!-- span--> test</span>
Any idea how i can solve this?
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
javascript - Strange behavior with dynamically added content
To do what you require there, add the new div, then prepend the button to it, like this: jsfiddle.net/RoryMcCrossan/u1a5svhx/26. Also note the ...
Read more >Handling dynamically created HTML in JavaScript - Medium
If you have a JavaScript plugin that needs to keep state, store that state on that element's dataset. Then, in the click handler,...
Read more >dynamic form and strange behaviour | Javascript
I am generating dynamic forms by overwriting an existing form but I am getting an unexpected behaviour. I have the code like shown...
Read more >Dynamic List weird behavior with form - Javascript Programming ...
Hi Guys! I ran across a weird behavior and wonder if anyone can tell me what's up with this code for generating a...
Read more >Handling common HTML and CSS problems - MDN Web Docs
HTML fallback behavior ... Some problems can be solved by just taking advantage of the natural way in which HTML/CSS work. Unrecognized HTML...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok got it working now. It had to do with the google translate module which makes a span closing tag like this </ span>. After replacing this for correct closing tag all works.
Thanks for the help 👍
All good, glad you found the issue.