Results 1 to 5 of 5

Thread: Array question!

  1. #1
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Array question!

    Hey,

    I have a question relating to arrays. Is it possible to use arrays to assign say a DIV created with javascript a value like [1], [2]..? I want the value to increase every time another div is created and to decrease when a div is deleted.

    Thanks so much!

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.

    Please include your code so that we can take a look at it, we can't do much without it. When you do post your code remember to use [code] tags. That includes [ html ], [ code ], and [ php ].


    Please do the above before someone can proceed in helping you.

    If you have no code, and wish for someone here to do it for you. Please include a more detailed description.

    Thanks!
    Nile
    Last edited by Nile; 03-17-2009 at 01:37 AM.
    Jeremy | jfein.net

  3. #3
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    How would you like to do this? Are you using DOM, or do you just want this to have each div to have an id which is unique so that they can easily be identified by javascript? How are you planning to 'delete' these divs? That's why I thought you were using DOM.

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I'm pretty sure hes using DOM. I don't know how you would do it without DOM. But please be more specific!

    Thanks,
    Nile
    Jeremy | jfein.net

  5. #5
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by magicyte View Post
    How would you like to do this? Are you using DOM, or do you just want this to have each div to have an id which is unique so that they can easily be identified by javascript? How are you planning to 'delete' these divs? That's why I thought you were using DOM.
    Nevermind the deleting, but you've got the idea. I just want them to have separate IDs.

    Quote Originally Posted by Nile View Post
    I'm pretty sure hes using DOM. I don't know how you would do it without DOM. But please be more specific!

    Thanks,
    Nile
    Haha, I'm a girl.

    To make things more simple, I just want to assign each DIV created a unique ID.

    And if you're wondering, I'm creating my DIVs using the createElement.

Bookmarks

Posting Permissions

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