Modifying the value of text input with js/ jquery
Posted: 18 Dec 2014, 15:36
How can I dynamically set /modify the values of certain form elements, more specifically certain input text fields? So far, whenever I load my html page, I am just getting the blank input field, but I want to add it the value of 1.
Here is an example of how I am trying to do this.
The reason this needs to be done dynamically is because the value of form could be different every time.
Here is an example of how I am trying to do this.
Code: Select all
<!doctype html>
<html>
<head>
<script type="text/javascript" src="javascript/jquery-1.6.1.min.js"></script>
</head>
<body>
<form id="form1">
<input type="text" name="q01" maxlength="1" />
</form>
<script type="text/javascript">
// here what JS /jQuery code so to set /modify value of #q01 ?
</script>
</body>
</html>