1

我有一个简单的代码:

//preview copy as it's being typed
$('#copyText').keyup(function(e){
    $('#copyPreview').html($('#copyText').val());
});

当用户输入 html - 他们可以看到保存时的预览。

However certain tags such as <ul> and <li> are not appearing. Other HTML works such as line breaks, bold, tables, even styles... just not lists (so far, from what I see) 

正如我检查过的那样,您可以假设它不是 css。

示例文本:

<b>All models are UL recognized <br><b>Important:</b> <br>
<ul><li>Adjustable range from -73 to 316°C (-100 to 600°F)</li>
<li>Resolution sensitivity of -17.7°C</li>
</ul>   
4

1 回答 1

0

val()习惯于

获取匹配元素集中第一个元素的当前值

html()而是用户

$('#copyPreview').html($('#copyText').html())
于 2013-05-14T20:30:52.580 回答