Question : Javascript not working?

Hi, could anyone tell me why this isn't working?


<script>
document.form1.name1.value='dddd';
document.getElementById("name2").value='jj';
</script>
<form id="form1" name="form1" method="post" action="">
  <input id="name" name="name" type="text" value="ss" />
<input id="name2" name="name2" type="text" value="ss" />
</form>

Answer : Javascript not working?

and you nedd to put the inline code after the fields :

1:
2:
3:
4:
5:
6:
7:
8:
<form id="form1" name="form1" method="post" action="">
  <input id="name1" name="name1" type="text" value="ss" />
<input id="name2" name="name2" type="text" value="ss" />
</form>
<script>
document.form1.name1.value='dddd';
document.getElementById("name2").value='jj';
</script>
Random Solutions  
 
programming4us programming4us