请问下我这个在FF和chrome为什么弹不出来选中的值
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>1.htm</title>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<style>
</style>
<script type="text/javascript">
function getSelectedText() {
if (window.getSelection) {
return window.getSelection().toString();
}
else if (document.getSelection) {
return document.getSelection();
}
else if (document.selection) {
return document.selection.createRange().text;
}
}
</script>
</head>
<body>
<form>
<textarea>
ewdfweewdwedweddddddddddddddddddddd
</textarea>
<input type="button" value="选择字后点我看看" onclick ="alert(getSelectedText())"/>
</form>
</body>
</html>