Insert text in textarea - Stack Overflow
我想大声告诉你
我想大声告诉你 2017-07-05 10:55:06
0
2
906

I want to insert text with a fixed beginning and end but a loop in the middle in a textarea, similar to

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mysql xmlns:xsi="http://www.w3.org/2001/ XMLSch...
<row>
...
</row>
</mysql>

If I want to loop the row part, writing $("#textarea").html($("#textarea").html() temp) can only loop the entire content. What should I do?

我想大声告诉你
我想大声告诉你

reply all(2)
Peter_Zhu

The fewer dom operations, the better. The best way is to loop first, then process and then insert, otherwise the performance may be greatly affected
For example:

var deafult = $('textarea').val();
   
default += temp;

$('textarea').val(default);
    
伊谢尔伦

Can’t you just splice it first and then insert it?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template