Thursday, January 12, 2012

object Key in javascript class/dictionary?


I have a Javascipt object which I use as dictionary




var obj={
xxx:'1'
yyy:'2'
}



However - xxx and yyy should be a jQuery object .



something like :




var obj =
{
$('#div1'):'1' ,
$('#div2'):'2'
}



is it possible ?



also, How can I get the " value " for key $('#div2') ?



p.s. I the $.data cant help me here since its also a key value and i need in the key - object Type also.

No comments:

Post a Comment