1

how can i access to tooptip of textbox using jquery ?!! or any asp control attribute !!

<asp:TextBox CssClass="myclass" ID="Name" runat="server" ToolTip="some tooltip">/asp:TextBox>

jquery:

$(document).ready(function() {        
        $('.myclass').click(function() {
                alert($(this).attr('ToolTip'));
           });
});

or just set my control to HTML

2 Answers 2

2

ToolTip attributes convert to title attributes in HTML. Try the following:

 alert($(this).attr("title"));
Sign up to request clarification or add additional context in comments.

Comments

1

Try this:

 $(function () {
        $('.mybutton').onclick(function () {
            var tooltip = "B";
            $('.mytb').attr('title', tooltip);
        });
    });

  <button type="button" CssClass="mybutton">Click Me!</button> 
  <asp:TextBox ID="TextBox1" runat="server" ToolTip="A" CssClass="mytb"></asp:TextBox>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.