此的jsfiddle解釋這一切 https://jsfiddle.net/qphoria/jh7p0oq2/1/Javascript:我怎樣才能從textarea替換換行符到div元素?
我如何讓DIV顯示爲多行不顯示文字標籤<br>
?
此的jsfiddle解釋這一切 https://jsfiddle.net/qphoria/jh7p0oq2/1/Javascript:我怎樣才能從textarea替換換行符到div元素?
我如何讓DIV顯示爲多行不顯示文字標籤<br>
?
使用的.html()將採取str作爲HTML並呈現它。 .text()只會將str呈現爲文本。
$('#display').html(str);
呃..很明顯...踢自己..謝謝! – Dss
不客氣:) –