<!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>
<title></title>
<script src="javascript/jquery-1.4.4.js" type="text/javascript"></script>
<script type="text/javascript">
function sayHello(txt) {
$("#"+txt).val("hello");
}
</script>
</head>
<body>
<input type="text" id="hello" />
</body>
</html>
但是却报了脚本错误,请问这是为什么呀? $("#"+txt).val("hello");这种写法有问题吗? |