Only allow certain tags in contenteditable div
0
I have a contenteditable div and using keyboard shortcuts like ctrl+i the user is able to format the text. And as they type the innerHTML changes reflecting the tags i.e: Hello <i>thanks for <br><br>for showing up<b> y'all b</b></i> This is fine, and works well for my purposes. but the issue arises that when I go to print the html in a different div IF a user adds any other html tags, they could really mess up the application. For instance, if they added a <script> tag or style etc.. How do I make it that the user is only allowed to add <i> , <br> , <b> , <s> , and without being able to add anything else? Any ideas? Thank you
javascript jquery angula