www.webdeveloper.com
Results 1 to 7 of 7

Thread: [RESOLVED] underline text in a label

  1. #1
    Join Date
    Jul 2004
    Posts
    10

    resolved [RESOLVED] underline text in a label

    Hi,
    How can I underline the text in a web-control Label?
    Thanks,
    Hezi

  2. #2
    Join Date
    Aug 2007
    Posts
    3,767
    In a <label>?
    Code:
    <style type="text/css">
    label {
    text-decoration:underline;
    }</style>
    Great wit and madness are near allied, and fine a line their bounds divide.

  3. #3
    Join Date
    Jul 2004
    Posts
    10

    underline text in label

    Thank you moderator,
    I intended to ask How can I underline the text in a web-control Label programmaticaly, using javascript?
    Thanks,
    Hezi

  4. #4
    Join Date
    Aug 2009
    Posts
    593
    This is one way:

    HTML Code:
    <label id="the_label">Some text</label>
    
    <script type="text/javascript">
    	document.getElementById("the_label").style.textDecoration = "underline";
    </script>

  5. #5
    Join Date
    Jul 2004
    Posts
    10

    underline-deUnderline

    Thank you thraddash,
    I would like also to go back from underline to plain text .


    document.getElementById("the_label").style.textDecoration="";

    does not work.
    Do you have a solution, please?
    Hezi

  6. #6
    Join Date
    Aug 2009
    Posts
    593
    This should do it:

    HTML Code:
    <script type="text/javascript">
    	document.getElementById("the_label").style.textDecoration = "none";
    </script>

  7. #7
    Join Date
    Jul 2004
    Posts
    10

    Underline-deanderiine

    Thank yoy thraddash,
    It works
    Hezi

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles