请问大虾,如何使光标在第二个框选中内容的时候。能对第二个框里的内容进行字体变大变小?
最好把第一个框改为textarea。
[html]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>光标获取问题</title>
</head>
<script language="JavaScript">
<!-- Hide from older browsers...
//Function to format text in the text box
function FormatText(command, option){
frames.message.document.execCommand(command, true, option);
frames.message.focus();
}
</script>
<body>
<table>
<tr>
<td>
<select language="javascript" id="select" title="字号大小" onChange="FormatText('fontsize',this[this.selectedIndex].value);" name="select" onMouseOver="window.status='选择选定文字的字号大小。';return true;" onMouseOut="window.status='';return true;">
<option class="heading" selected>Font Size
<option value="7">7
<option value="6">6
<option value="5">5
<option value="4">4
<option value="3">3
<option value="2">2
<option value="1">1</option>
</select>
<script language="javascript">
document.write ('<iframe src="textbox.asp?action=new" id="message" width="600" height="200" align=left></iframe>')
frames.message.document.designMode = "On";
</script>
</td>
</tr>
<tr>
<td colspan="7"><textarea name="ffree1" cols="80" rows="8" > </textarea> </td>
</tr>
</table>
</body>
[/html]