I want to do the following things:
- Create 3 text boxes and 1 button
- Type lower case letters into the 3 boxes
- Click on the button
- Upon clicking on the button, the letters are converted to upper case
How come the letters I'm typing into the boxes aren't being converted to upper case?
Here's my code:
<html>
<head>
<script>
function upperCase() {
var x = document.getElementById("form_1");
x = x.value.toUpperCase();
}
</script>
</head>
<body>
<form name="form1" id="form_1" method="post">
Enter your name:
<input type="text" name="nameInput">
Enter your street address:
<input type="text" name="streetInput">
Enter your city/state:
<input type="text" name="cityStateInput">
<input type="button" name="upperCaseButton" value="Convert to Uppercase"
onclick="upperCase()">
</form>
</body>
</html>