I have some HTML that looks like this:
<div class="MyClass"></div>
<div class="MyClass"></div>
<div class="MyClass"></div>
<div class="MyClass">
....stuff
<select>
<option value="1">blahblah</option>
<option value="2">blahblah</option>
</select>
</div>
<div class="MyClass">
....stuff
<select>
<option value="5">blahblah</option>
<option value="10">blahblah</option>
</select>
</div>
As you can see, I have several divs of class MyClass and some of these divs have a select box inside.
I have the following javascript that's used to trigger an event:
$(document).ready(function () {
$('.MyClass').click(function () { DoThing($(this)); });
});
The DoThing function looks like this:
function DoThing(TheDiv) {
var Value = parseInt(TheDiv.find(select).val());
alert(Value);
}
That's the part I'm struggling on: how do I find the value of the select that's selected? For now, it alerts only 1.
Thanks for your suggestions.