www.webdeveloper.com
Results 1 to 2 of 2

Thread: Iterate through input tags and get the ones needed

Hybrid View

  1. #1
    Join Date
    Nov 2010
    Posts
    1

    Question Iterate through input tags and get the ones needed

    Hello, I have a problem in Javascript that I really cant figure out, I've tried for days! here it goes:

    I need to iterate through a form and get all the elements that has a class like
    "required" and then, save this elements id, because I have label elements that has a for="" tag with the same as the id for the input/dropdown in the form. To all these labels I need to apply a "*" in the end of the label. And all this in an onload function.

    I have tried everything I can come up with but now I'm close to giving up so now I need help, how can I get these values and do this?

    Very thankful for help!

  2. #2
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Is this a homework question and what do you have so far?

    The content of a label's for attribute is stored in labelReference.htmlFor
    Where used, return should be executed unconditionally and always as the last statement in the function.

    That's my signature, it's not part of the damn post!

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