Thursday, November 17, 2016

Lab 3: JavaScript Dispply Possibilities

      This is one of the complex laboratories that we have to create. In this lab, we have to show all the different display possibilities with JavaScript in the browser. This includes using alert() or window.alert() that pops up a window of notification on the browser, an HTML output using document.write() that can write in the HTML side, write into a HTML element using innerHTML, and last, use console.log() to log information into the console of the browser. We also need a different type of pop up that asks that user ok or cancel, a prompt that lets the user input into the browser. And demonstrate that we know how to use variables.

     So first I use alert() to greet the user, said I wanted to introduced myself, and told the user of a number I created using variables and JavaScript algorithms. Then I would use document.write() to write down the introduction about myself on the webpage. Then I have a few buttons below that to showcase the other code required in this lab. The first buttons ask the user whether he/she want to provide their name, then there will be another button that prompts the user to enter their name. After the user answered their name, there will be a greeting to the user and ask the user to see more by clicking another button, but there aren't actually any more to it, it's just to show the different type of possibilities.

No comments:

Post a Comment