Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
missing6 committed Dec 13, 2023
1 parent f398d12 commit 45fda64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<h2>Input Field Change Listener</h2>

<input type="number" id="myInput" placeholder="Type something...">
<label for="displayText">Output: </label>
<p id="displayText"></p>

<script src="index.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ var displayText = document.getElementById('displayText');
// Add the event listener
inputField.addEventListener('input', function(event) {
// Update the displayText content with the input field value
displayText.textContent = 'Input changed to: ' + event.target.value;
displayText.textContent = event.target.value;
});
3 changes: 2 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
input {
text-align: right;
box-shadow: bisque;
}
h2 {
text-align: center;
background-color: aqua;
}

0 comments on commit 45fda64

Please sign in to comment.