1<!--html-->
2<input type="hidden" name="customerID" id="customerID1" value="aa190809" />
3<input type="hidden" name="customerID" id="customerID2" value="aa190810" />
4<input type="hidden" name="customerID" id="customerID3" value="" />
5
6<script>
7$("input[name=customerID]").each(function(){
8 //get attributes
9 console.log(this.id + " with value: " + this.value);
10
11 //set values
12 if (this.value == "") {
13 this.value = "my new value";
14 }
15
16});
17</script>