Question: i have html form 

```
<form name="updatefrm" id="updatefrm" action="" method="post">
<input type="hidden" name="98" id="98" value="" />

<input type="hidden" name="99" id="99" value="" />
<input type="hidden" name="100" id="100" value="" />
<input type="hidden" name="101" id="101" value="" />
<input type="hidden" name="102" id="102" value="" />
<input type="hidden" name="updateqty" id="updateqty" value="1" />
</form>

```

now i want to assign value to this elements 
i m using following javascript code for element with id 98 

```
document.updatefrm."98".value = elements[0].value;

```

but its giving me error in console.

can any one help me with this ?

Answer: 
You should use `document.formname` to access forms as not all browsers support this(actually I'm not sure if any does). use `document.forms.formname` instead. Also to access a numeric property of an object use bracket notation instead of dot notation.

```
document.forms['updatefrm']['98'].value = elements[0].value;

```
You can also use `getElementById` to set the value. Beside this also check [Javascript Naming Convention](http://javascript.crockford.com/code.html)

`document.getElementById('98').value = "YOUR VALUE";`