Given the following javascript:
function foo(selectControl) { ... }
and the following html:
<select onchange="foo(this)"> ...
In jQuery, how can I simulate the following functions:
$('#selectList :selected').text();
when instead I go around a real DOM object. I know that I can wrap a DOM object and call operations like
$(selectControl).val();
but I specifically ask how to replicate the jQuery string selector mechanism:
$('#selectList :selected')
source
share