以下适用于 FireFox 和 Chrome,但不适用于 IE -
<html>
<head>
<title>test IE</title>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
</head>
<body>
<button onClick="fTest2()">test textarea</button>
<br />
<textarea rows="4" cols="50" id="log" > textHolder . . . </textarea>
<script type="text/javascript" >
var currentLine = 3;
var strXml = "<xmlString id='misssing' >" + currentLine + "</xmlString>";
function fTest2() {
$('#log').html(strXml);
}
</script>
</body>
</html>