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.
精彩评论