Příklad ukazuije, jak lze změnit obsah HTML značky (objektu).
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta name="generator" content="PSPad editor, www.pspad.com"> <title> </title> <script> function i(text){ document.getElementById("popis").innerHTML=text; } </script> </head> <body> <input type="button" value="zapiš" onClick="i('dobrý den');"> <span id="popis"> </span> </body> </html>