Home>

Only for Chrome.
If i change the value of<textarea>with the jQuery below, the tag will be sent as a special character.

Source code
&lt;form name = "post" method = "post" action = "http://example.com/testpost/"&gt;
  &lt;div&gt;
    &lt;p&gt;Reply to:&lt;span&gt;hanako&lt;/span&gt;&lt;/p&gt;
    &lt;textarea name = "message" placeholder = "message"&gt;&lt;/textarea&gt;
    &lt;button type = "submit" name = "submit"&gt;Send&lt;/button&gt;
  &lt;/div&gt;
&lt;/form&gt;
// Change "value" of "textarea" before sending
$('body'). on ("click", '# submit', function (e) {
  e.preventDefault ();
  var nicename = $('# nicename'). text ();
  var message = $('textarea'). val ();
  $('textarea'). val ('&lt;span&gt;' + nicename + '&lt;/span&gt;' + message);
  $('form'). submit ();
});
Problem results

When sending from Firefox, the output is below,

<p><span>hanako</span>Hello!</p>


If i send from Chrome, it will be output as a special character as shown below.

<p>&lt;span class = "replyto"&gt;hanako&lt;/span&gt;Hello!</p>


I triedunescapewith jQuery, but it didn't work.

Is Chrome a function to escape the tag in the value of<textarea>when sending?

If so, how can I avoid it?

Let us know your wisdom. Thank you very much.