Results 1 to 2 of 2

Thread: Can't get Javascript to change label text

  1. #1

    Thread Starter
    Lively Member nmaccari's Avatar
    Join Date
    Mar 2002
    Posts
    67

    Question Can't get Javascript to change label text

    I have tried everything. I simply need some text in a label to change when a user highlights a link. Here is a list of different statements I tried but none of them worked. Please help. Thanks.


    hypDataDriller.Attributes.Add("OnMouseOver", getElementById('lbl').InnerHTML='d')

    hypDataDriller.Attributes.Add("OnMouseOver", getElementById('lbl').InnerText='d')

    hypDataDriller.Attributes.Add("OnMouseOver", getElementById('lbl').Text='d')

    hypDataDriller.Attributes.Add("OnMouseOver", getElementById('lbl').Value='d')
    Last edited by nmaccari; Aug 31st, 2006 at 04:30 PM.
    Nick

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Can't get Javascript to change label text

    You can't expect those to work because getElementById() would be interpreted as a codebehind function, not a javascript STRING.

    Code:
    hypDataDriller.Attributes.Add("OnMouseOver", "getElementById('lbl').InnerHTML='d';")

Posting Permissions

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



Click Here to Expand Forum to Full Width