Problem get data from select, input-hidden value in Firefox
My code is:
- <div class="blockTxt">
- <input type="hidden" name="item_type" value="<?php echo $r->cat;?>">
- <div class="foodName">
- <h4 class="item_name"><?php echo $r->name;?></h4>
- </div>
- <div class="btnFood">
- <select class="quantity-select">
- <option selected="selected" value="8">8 </option>
- <option value="16">16 </option>
- <option value="24">24 </option>
- </select>
- </div>
- <?php echo $r->cont; ?>
- </div>
- <button class="btn" data-id="<?php echo $r->id;?>">
- Мake order
- </button>
and JS-code:
- function addToCart(e){
- ...........
- var cartData = getCartData() || {},
- parentBox = this.parentNode,
- itemId = this.getAttribute('data-id'),
- itemTitle = parentBox.querySelector('.blockTxt > .foodName > .item_name').innerHTML,
- itemPrice = parentBox.querySelector('.item-price').innerHTML,
- itemQuant = parentBox.querySelector('.blockTxt > .btnFood > .quantity-select option:checked').value,
- itemType = parentBox.querySelector('.blockTxt input[name="item_type"]').value;
- ................................
- }
In Chrome browser it works, but in Firefox two last strings are not.
- itemQuant = parentBox.querySelector('.blockTxt > .btnFood > .quantity-select option:checked').value,
- itemType = parentBox.querySelector('.blockTxt input[name="item_type"]').value;