日期:2014-05-18  浏览次数:20676 次

响应按纽的问题,在线等
比如说在个爷面中只有一个按纽,怎么响应它   ,
例如:
<html>
  <script   type= "text/javascript ">
        function     search(){

        }
    </script>
<body>
        <input   type= "button "   onclick= "search() "   name= "查看通道 ">
</body>
</html>
在javascript怎么写。   声明:按纽不在表单里

------解决方案--------------------
你随便写个form在外面不就成了?没有form的input没用
------解决方案--------------------
没明白什么意思
------解决方案--------------------
function search(){
alert( '你想干嘛? ');
}

你的意思是你想提交form吗?
如果是,假设
<form id= 'formx ' .../>
你可以
function search(){
document.getElementById( 'formx ').submit();
}
------解决方案--------------------
把按钮放到form中试试.
<html>
<script type= "text/javascript ">
function search(){

}
</script>
<body>
<form>
<input type= "button " onclick= "search() " name= "查看通道 ">
</form>
</body>
</html>

------解决方案--------------------
楼主你真无聊...
------解决方案--------------------
在web.xml中配好了就可以直接定位到Action,
location.href= 'delete.do?‘;

------解决方案--------------------
<html>
<script type= "text/javascript ">
function search(){
document.form1.button1.onclick = function(){里面写具体点击按钮后响应的事件代码};
}
</script>

<body>
<form name= "form1 ">
<input type= "button " id= "button1 " onclick= "search() " name= "查看通道 ">
</form>
</body>
</html>