PDA

View Full Version : Array question!



xilovemusic123x
03-16-2009, 06:28 PM
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!

Nile
03-17-2009, 01:27 AM
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

magicyte
03-17-2009, 01:36 AM
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.

Nile
03-17-2009, 01:38 AM
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

xilovemusic123x
03-17-2009, 03:54 PM
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.


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.