jQuery makes it easy to use css selectors to access elements. However, if you do not want to use jQuery, you can access the element this way, I suppose.
theForm['bill.street1'].value = theForm['ship.street1'].value;
I have not tested this, but it should work, because periods are an alternative method of accessing the array, iirc.
Be sure to use theForm['bill.street1'].value = theForm['ship.street1'].value;
not theForm.['bill.street1'].value = theForm.['ship.street1'].value;
. Additional periods make the format incorrect, in the same way using array.[2]
instead of array[2]
will invalidate it.
source share