这段代码在IE里能够赋值给text  但是在FF里就不行,不知道什么原因啊。
请大家帮忙解答一下。<!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>无标题文档</title>
</head><body>
<input name="" type="text" id="select" />
<li onMouseOver="this.style.background='#cccccc'" onMouseOut="this.style.background='#ffffff'" onMouseDown="select.value=this.innerHTML">显示文字</li>
</body>
</html>

解决方案 »

  1.   

    document.getElementById('select').value
    <!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>无标题文档</title>
    </head><body>
    <input name="" type="text" id="select" />
    <li onMouseOver="this.style.background='#cccccc'" onMouseOut="this.style.background='#ffffff'" onMouseDown="document.getElementById('select').value=this.innerHTML">显示文字</li>
    </body>
    </html>