Advertisement
bobreyes

HelloWorld.webapp-hello.js

Feb 3rd, 2015
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Refer to UI elements
  2. var button = document.getElementById('MyButton');
  3. var txtInput = document.getElementById('MyInputText');
  4.  
  5. // Bind click event of the button with an event listerner
  6. button.addEventListener('click', function () {
  7.     'use strict';
  8.     var text = txtInput.value;
  9.  
  10.     // Show alert box with this text
  11.     window.alert(text);
  12. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement