Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:CheckBox ID="CheckBox1" runat="server" Text="Open" />
- function changeCheckboxText(checkbox)
- {
- if (checkbox.checked)
- checkbox.nextSibling.innerHTML = 'on text';
- else
- checkbox.nextSibling.innerHTML = 'off text';
- }
- <asp:CheckBox runat="server" ID="chkTest" onclick="changeCheckboxText(this);" />
- $("input[id$=CheckBox1]").click(function() {
- if ($(this).attr("checked")) {
- $(this).next("label:first").text("Open");
- }
- else {
- $(this).next("label:first").text("Close");
- }
- });
- CheckBox1.Attributes.Add("JavaScipt")
Add Comment
Please, Sign In to add comment