This example does not work

<form name=a action='p.php'>
<input type=text name='b[0]' value=''>
<input type=text name='b[1]' value=''>
</form>

<script language=JavaScript>
a.b[0].value="khaled";
a.b[0].value="mamdouh";
</script>



______

I want to give b[0] input value using JavaScript , How ?