I have an hidden input field with a value,
<form>
<input type="hidden" value="product"/>
<select class="select" name="select3" id="select3">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
</form>
I need to get the value of input field once a button is clicked but I only get the text object why is that?
var items[];
$('#my-add-button-sides').click(function() {
$('.select option:selected').each(function() {
var $this = $(this);
items.push($this.prev($('input[type=hidden]').val ()
));
});
thanks