chrome和IE中的html()和val()用法

时间:2019-01-02 13:14:47

标签: jquery

我有以下代码片段,该片段遍历从Web方法返回的字典,并将一些值附加到textarea。 IE可以正常工作:

$.each(results, function (key, value) {                           
  if ($('#TextArea1').val() == '') {
    $('#TextArea1').html(key + '
');                      
  } else {                                      
    $('#TextArea1').html($('#TextArea1').val() + key + '
');
  }
});

这会在IE中很好地附加在新行上,但是在chrome中不会添加任何内容。 chrome不支持文本区域中换行符的
字符吗?

TIA !!!!!!

0 个答案:

没有答案
相关问题