I am trying to get all elements inside of a div that are texboxes only. I have asp textboxes inside my div and also buttons
<div id="wrapper">
<div id="gameInfo">
<asp:TextBox ID="gameTitle" runat="server" MaxLength="10" Width="150px"></asp:TextBox>
<asp:TextBox ID="gameType" runat="server" MaxLength="10" Width="150px"></asp:TextBox>
<asp:TextBox ID="gameprice" runat="server" MaxLength="10" Width="150px"></asp:TextBox>
<input type="button" id="button1" value="enable" onClick="myFunc"/>
</div>
</div>
javascript:
<script type="text/javascript">
function myFunction() {
document.getElementById("wrapper").querySelectorAll('input[type=text]').disable = true;
}
</script>
here I have tried to get all elements in wrapper and then do a queryselectall to get all inputs that equal text but it doesn't seem to be working I must be doing something wrong and also I would want this to happen as soon as the page loads
No comments:
Post a Comment