<!DOCTYPE html>
<
html
><
head
></
head
><
body
>
<div id="bla"> </div> <div id="bla2"> </div>
</
body>
</
html
>
<
script
type
="
text/javascript
"> window.addEventListener('load', function() {
function appendText(element, theString) { return element.appendChild(document.createTextNode(theString)) } function myFunction(number) { return number * 2; } appendText(bla, myFunction(1998)); appendText(bla2, myFunction(20) + " " + myFunction(10));
}) </
script
>
<
style
type
="
text/css
">
</
style
>
RESULT: (open your console with F12 or CTRL-SHIFT-K)