-2

In a form on a specific site (others work), there's an

<input type=text value="1">

Update the value to "3", without submitting the form, and go to Chrome's console.

document.getElementById('updates_959338052').value 

returns 1. Also $("..").val()

Can't figure out why it's not working on this site. To replicate: http://365nailart.com/products/essie-nail-polish-all-in-one?variant=959338052 click Add to cart, the My Cart and Checkout. Then change the quantity value.

After a few WTFs and googling, I'm kindly asking for help.

Marius
  • 1,659
  • 3
  • 22
  • 31

1 Answers1

2

You have two input elements with the same id. The id in html document must be unique. When you try to do document.getElementById('updates_959338052'), it is selecting the first one which is not the one displayed, maybe from mobile compatible part of your website.

nisargjhaveri
  • 1,469
  • 11
  • 21