关于html表单按钮的问题

来源:百度知道 编辑:UC知道 时间:2024/09/27 15:12:40
假设有两个按钮分别为“确认”和“取消”,再点击了第一个按钮后,让它失效,即变为灰色。可以这样实现 <input type="button" value="提交" onclick="javascript:{this.disabled=true;document.form1.submit();}">如果想点击了取消后按钮在变回来怎么实现

<html>
<head>
<title>test</title>
</head>
<body>
<form>
<input type="button" onclick="javascript:{this.disabled=true}" id="submit1" name="submit1" value="tijiao">
<input type="button" onclick="javascript:{document.getElementById('submit1').disabled=''}" name="quxiao2" value="quxiao">
</form>
</body>
</html>