怎么写search的函数。比如一个text框,然后onclick直接用百度search
如题
[解决办法]
<title>无标题文档</title>
<script type="text/javascript">
function finds(){
var a=document.getElementById("test").value;
window.open("http://www.baidu.com/s?wd="+encodeURIComponent(a));
}
</script>
</head>
<body>
<input type="text" id="test">
<input type="button" onclick="finds()" value="find">
</body>
不知这样行不行 试了几个貌似可以 以前看到过一个例子 忘了放哪了 我给你找找
[解决办法]
getElementsByName("test")[0].value
[解决办法]