So, I want to set up an associative array (although I've read I should use Object rather than Array for this), and then access the value that matches the key I have. In PHP I would use
$options = array();
$option['A'] = "available";
$option['U'] = "unavailable";
etc...
$key = "U";
$class = $option[$key] // sets class to 'unavailable'
At present I've got in JS
var options = new Object();
options['A'] = 'available';
options['U'] = 'unavailable';
etc.
var key = "U";
var class = ?
How do I set the class to equal options['U']? I've looked through various posts and help on the subject and am starting to get lost with various functions etc. I have jQuery in use too if that's easier.
And whilst we're on the subject, is it possible get the key if you know the value?
tyvm
