帮帮忙,怎么把光标定位在字母ab之间?
页面如下,怎么把光标移动到字母ab之间?
<HTML>
<head>
<script language="javascript">
function setFocus()
{
;
}
</script>
</head>
<BODY bgcolor = "#cccccc">
<IFRAME NAME="objEditor" WIDTH="600" height="400"></IFRAME>
<br><br>
<input type="button" value="setFocus" onClick="setFocus();">
</BODY>
</HTML>
<script language = "javascript">
objEditor.document.designMode='On';
setTimeout('objEditor.focus()',100);
setTimeout("objEditor.document.selection.createRange().pasteHTML('ab')",200);
</script>