0

I have an element in my html-code, that holds a completely new html code written by a user, for previewing after codeing into a textarea (simple: a web-editor).
My problem starts when the user types in his code with an id or/and a class, that is already in my code.
So imagine this:

<html>
<body>
<div id="hi">That is my text</div>
<textarea id="here_writes_the_user_his_code"></textarea>
<section id="user_input">
<!-- All following is from the user...-->
  <html>
   <body>
     <div id="hi">Too bad, hi has already been used...</div>
   </body>
  </html>
<!--...til here!-->
</section>
</body>
</html>

Any idea of solving this?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by floatingDivs
0

Well, assuming they are pasting in an HTML page, that's to be expected. It's also to be expected if you are using an iFrame to display their content. On the other hand, if all you are doing is displaying what THEY WROTE into the textarea (and you are 100% sure they didn't write html tags, you must be inserting it in some way we don't have any idea about.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.