如何隐藏和显示按钮我试过隐藏但不显示第二个按钮

时间:2016-06-10 01:36:58

标签: javascript c# asp.net

如何隐藏和显示按钮我已尝试隐藏但不显示第二个按钮

function mybutton1() {
    document.getElementById('<%=Button1.ClientID%>').style.display = "none";
}

function mybutton2() {
    document.getElementById('<%=Button2.ClientID %>').style.display = "block";
}

1 个答案:

答案 0 :(得分:-1)

你想这样做

function mybutton1() {
  document.getElementById('Button1').style.display = "none";
}

function mybutton2() {
  document.getElementById('Button1').style.display = "block";
}
<table>
  <tr>
    <td>
      <input type="button" name="button1" value="button1" id="Button1" onclick="mybutton1();">
    </td>
    <td>
      <input type="button" name="button2" value="button2" id="Button2" onclick="mybutton2();">
    </td>
  </tr>
</table>