Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Refer to UI elements
- var button = document.getElementById('MyButton');
- var txtInput = document.getElementById('MyInputText');
- // Bind click event of the button with an event listerner
- button.addEventListener('click', function () {
- 'use strict';
- var text = txtInput.value;
- // Show alert box with this text
- window.alert(text);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement