<< Back

Exercise 1.1 - Buttons and Inputs

a) Hello World!

This is the console. All output created with writeLog() is shown here.

You can use this input field to type something and use the value in your program. Use getInut("myInput") to get the value.

The button below prints the content of the input field to the console above.


script.js

This is the JavaScript code behind the above application.

/* global writeLog, getInput */
writeLog("Solution for exercise 1.1 a)");
// Log "Hello World" to the console
writeLog("Hello World!");
function printText() {
var text = getInput("myInput");
writeLog(text)
}