开发者

JQuery .html() working in IE but not in Firefox

开发者 https://www.devze.com 2023-03-21 00:16 出处:网络
I have a div with id=slRecipelList and a text box with id= txtRecipesWk1 containing a HTML string. I w开发者_运维问答ant to copy the HTML string from the text box to the div, here is my code:

I have a div with id=slRecipelList and a text box with id= txtRecipesWk1 containing a HTML string. I w开发者_运维问答ant to copy the HTML string from the text box to the div, here is my code:

    $('#slRecipelList').html($('#txtRecipesWk1').val());

The code works fine in IE (V 8) but not in Firefox (V 3.6.18), when I step through the code and do console.log($('#slRecipelList').html()), it returns null.

I’ve also tried append (after emptying the div) with same result – okay in IE, not working in Firefox.

Am I missing something obvious or silly here?


Check your HTML comments, they might be giving you problems.

0

精彩评论

暂无评论...
验证码 换一张
取 消