Results 1 to 5 of 5

Thread: Element Arrays...

  1. #1

    Thread Starter
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Resolved Element Arrays...

    Is it possible to have element arrays in HTML? Like for instance:
    Code:
    <span name="test">&nbsp;</span>
    <span name="test">&nbsp;</span>
    <span name="test">&nbsp;</span>
    would create an element array of test[0-2]
    Last edited by Disiance; Dec 26th, 2005 at 12:21 PM.
    "I don't want to live alone until I'm married" - M.M.R.P

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Element Arrays...

    No but you could name them test1, test2 etc. and in a loop append the number to "test" to refer to the element.

  3. #3

    Thread Starter
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: Element Arrays...

    Could that be referenced dynamically in JavaScript? I.e.
    Code:
    document."test"+ii.value = "...";
    "I don't want to live alone until I'm married" - M.M.R.P

  4. #4

    Thread Starter
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: Element Arrays...

    Oh duh...nvm... I could set the ID property and reference it with getElementById("test"+ii);

    duh, thank you.
    "I don't want to live alone until I'm married" - M.M.R.P

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Element Arrays...

    Yup

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