We would like to know how to set input text value.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!--from ww w . ja va2 s.c o m-->
document.getElementsByName('capacity')[0].value = 'new value from Javascript';
}
</script>
</head>
<body>
<input name="capacity" type="text" value="blah blah blah">
</body>
</html>
The code above is rendered as follows: