VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Change Button Text Using Java Script

by Gehan Fernando (47 Submissions)
Category: Internet/HTML
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Tue 26th April 2011
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Change Button Text Using Java Script

Rate Change Button Text Using Java Script




    function changeText(value) {

        document.getElementById('<%= Label1.ClientID %>').innerHTML = value;

    }
    
</script>

<head runat="server">
    <title>Change Text</title>
</head>

<body>
    <form id="form1" runat="server">
    <div>
    </div>
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
    <br />
    <br />
    <asp:Button ID="ButtonOne" runat="server" Text="Button One" OnClientClick="changeText('Button One');return false;" />
    &nbsp;&nbsp;
    <asp:Button ID="ButtonTwo" runat="server" Text="Button Two" 
        OnClientClick="changeText('Button Two');return false;"/>
    &nbsp;
    <asp:Button ID="ButtonThree" runat="server" Text="Button Three" 
        OnClientClick="changeText('Button Three');return false;" />
    <br />
    </form>
</body>
</html>

Download this snippet    Add to My Saved Code

Change Button Text Using Java Script Comments

No comments have been posted about Change Button Text Using Java Script. Why not be the first to post a comment about Change Button Text Using Java Script.

Post your comment

Subject:
Message:
0/1000 characters