[jQuery] Best way to add attributes/extend element

2009-08-13 Thread twooton
When you need for a certain element (say a text input box) to remember some data, what is the best way to do this? Can you extend the input box object with jquery? Right now i've been storing it in the rel tag $('#testInput').attr('rel','extrainfo') it just seems like there should be a better way

[jQuery] Creating a copy of associative array

2009-02-10 Thread twooton
I cant figure out how to create a unique copy of an associate array. I need to create a backup of an array, but since arrays and objects are always passed by reference in javascript it ends up replicating whatever changes I do to the first array over to the backup. I would use the .slice() method