This Meteor server side code is trying to get the amount 77 which is in this html string but my selector is returning empty object. How can I get 77 out of this html? Thanks
$('select[name=paid] option').data();
<td class="displayValue">
<select name="paid" id="paidId"><option value="77.00" selected="selected">77.00</option>
<option value="Other">Other</option></select>
</td>
</tr>
This Meteor server side code is trying to get the amount 77 which is in this html string but my selector is returning empty object. How can I get 77 out of this html? Thanks
$('select[name=paid] option').data();
<td class="displayValue">
<select name="paid" id="paidId"><option value="77.00" selected="selected">77.00</option>
<option value="Other">Other</option></select>
</td>
</tr>
Share
Improve this question
edited May 23, 2016 at 19:47
Fred J.
asked May 23, 2016 at 19:07
Fred J.Fred J.
6,03913 gold badges60 silver badges112 bronze badges
1 Answer
Reset to default 14$('select[name=paid] option').first().attr('value')
Should work! Your code is too general and won't return anything because there is more than one option.