急,javascript实现字体加粗,在线等!
看下代码:
<html>
<head>
</head>
<body>
<input type=button value="加粗" onClick=document.execCommand('Bold');>
ahdfaljfasdf as
</body>
</html>
这个点击按钮可以实现字体的加粗,要是添加一个textarea后就不行了,代码如下:
<html>
<head>
</head>
<body>
<input type=button value="加粗" onClick=document.execCommand('Bold');>
<textarea id="hehe">
ahdfaljfasdf as
</textarea>
</body>
</html>
现在要在这个textarea中实现字体的加粗,该怎么修改?在线等答案。