Getting Started

Create a new project in the ICE Code Editor. Use the Empty project template and call it Functions.

After the opening <script> tag, delete the line that says “Your code goes here,” and enter the following JavaScript.

 
var​ log = document.createElement(​'div'​);
 
log.style.height = ​'75px'​;
 
log.style.width = ​'450px'​;
 
log.style.overflow = ​'auto'​;
 
log.style.border = ​'1px solid #666'​;
 
log.style.backgroundColor = ​'#ccc'​;
 
log.style.padding = ​'8px'​;
 
log.style.position = ​'absolute'​;
 
log.style.bottom = ​'10px'​;
 
log.style.right = ​'20px'​;
 
document.body.appendChild(log);
 
 
 
var​ message = document.createElement(​'div'​);
 
message.textContent = ​'Hello, JavaScript functions!'​;
 
log.appendChild(message);
 
 
message ...

Get 3D Game Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.