If I have an associative array like this:
var names = { '10watt' : '_ULR', '20watt' : '_ULR', '30watt' : '_ULR', '40watt' : '_ULR', '50watt' : '_ULR', '60watt' : '_ULR', '75watt' : '_ULR', '100watt' : 'ULCR', '120watt' : 'ULCR', '150watt' : 'ULCR' };
How to write the key value to the browser if the key is this.id?
I tried this, but it did not work (#name is the div that I want to put in the text:
$('#name').text(names(this.id));
source
share