jQuery object
jQuery object
I have this snippet of code (below)...
$('select').click(function() {
var selected = this.id;
var clickedVal = $(this).val();
var clickedCnt = $(selected+ 'option:selected').text();
... which won't work as "var selected" cannot be inserted into the jQuery object like this. I'm trying to rationalise some code which works fine but is repetative and thus rather unsatsifying. Can anyone tell me how to 'insert' the variable value of "this.id" into the 4th line above so I can retrieve the selected value from any select element on the page?
Cheers
SaminOz.