Created
April 21, 2020 15:11
-
-
Save azamsharp/225af97dc5939e8bb65d47b750092a2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// access textbox | |
let fullNameTextBox = document.getElementById("fullNameTextBox") | |
// access button | |
let submitButton = document.getElementById("submitButton") | |
//fullNameTextBox.value // ??? | |
/* | |
function submitButtonPressed() { | |
console.log("Submit button pressed") | |
} */ | |
submitButton.addEventListener("click",function() { | |
// get the value in the textbox | |
let fullName = fullNameTextBox.value | |
// print out the value on the console | |
console.log(fullName) | |
}) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<input type="text" id="fullNameTextBox"></input> | |
<button id="submitButton">Submit</button> | |
<script src="js/app.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment