点击一个 input 把 另一个 input 清空 | 2019-01-23

调用方法 onclick="setadisable()"

<div>
     <td>
       <input type="text" id="one" name="XXXXX" onclick="setTwoDisable()" >
     </td>
     <td>
       <input type="text" id="two" name="companyname" onclick="setOneDisable()">
     </td>
</div>
<script type="text/javascript">
    //将 id 为 two 的 input 框的 value 值清除
    function setTwoDisable()
    {
        $('#two').val('');
    }

    //将 id 为 one 的 input 框的 value 值清除
    function setOneDisable()
    {
        $('#one').val('');
    }
</script>

猜你喜欢

转载自blog.csdn.net/weixin_33766168/article/details/87510959