Kada kliknete na dugme Demo pojeviće se iskakajući prozor nakon 5 sekundi.
<html>
<head>
<script type="text/javascript">
function timedMsg() {
       var t=setTimeout("alert('Poruka je prikazana poslije 5 sekundi!')",5000);
}
</script>
</head>
<body>
       <form>
              <input type="button" value="Demo!" onClick="timedMsg()" />
       </form>
</body>
</html>



Kada kliknete na dugme Startaj tajmer , u tekst polju će se odbrojavati sekunde (zauvjek) počevši od 0.
<html>
<head>
<script type="text/javascript">
       var c=0;
       var t;
       var timer_is_on=0;
function timedCount(){
       document.getElementById('txt').value=c;
       c=c+1;
       t=setTimeout("timedCount()",1000);
}
function doTimer(){
       if (!timer_is_on){
              timer_is_on=1;
              timedCount();
       }
}
</script>
</head>
<body>
       <form>
              <input type="button" value="Startaj tajmer!" onClick="doTimer()">
              <input type="text" id="txt">
       </form>
</body>
</html>



Animirano dugme u kojem se pojavljuje tekst karakter po karakter.
<html>
<body onLoad="banner()">
<script type="text/javascript">
       var i = 0;
       var TextNumber = 0;
       var TextInput = new Object();
       var HelpText="";
       var Text = "";
       var Speed=300
       var WaitSpace=" "
TextInput[0] = "Klikni me!";              // ovdje se piše tekst koji se pojavljuje na dugmetu
TextInput[1] = ":| :) :] :> :D :X";
TotalTextInput =1;
       for (var addWait = 0; addWait <= TotalTextInput; addWait++) {
        TextInput[addWait]+=WaitSpace;
       }
       var TimerId
       var TimerSet=false;
function startBanner (form) {
       if (!TimerSet){
       TimerSet=true;
       banner();
       }
}
function banner() {
       Text=rollMessage();
       TimerId = setTimeout("banner()", Speed);
       document.form2.banner.value=Text;
}
function rollMessage () {
              Wait_yn=false;
              i++;
              var CheckSpace = HelpText.substring(i-1, i);
               CheckSpace = "" + CheckSpace;
              if (CheckSpace == " ") {
                     i++;
              }
              if (i >= HelpText.length+1) {
                     i=0;
                     if (TextNumber < TotalTextInput) {
                            TextNumber++;
                     }
                     else {
                           TextNumber = 0;
                     }
              initBanner();
              }
              Text = HelpText.substring(0, i);
              return (Text);
}
function initBanner() {
       Text = TextInput[TextNumber];
       HelpText = Text;
       startBanner ();
}
function stopBanner() {
       TimerSet=false;
       clearTimeout (TimerId);
}
function resetBanner(){
       TimerSet=false;
       clearTimeout (TimerId);
       TextNumber=0;
       i=0;
       Speed=300;
       document.form2.banner.value=" ";
       initBanner();
}
</script>
<center>
      <form name="form2" onSubmit=null>
            <input type="submit" name="banner" value="..Submit.." onClick="alert ('Cool')"> <br>
      </form>
</center>
</body>
</html>



Kada pritisnete na dugme biće prikazan upisami tekst pored dugmeta.
<html>
<body>
<script type="text/javascript">function seeTextArea (form) {alert (form.myarea.value);}</script>
      <form name="myform">
            <input type="button" name="button3" Value="Popup" onClick="seeTextArea(this.form)">
            <textarea name="myarea" cols="40" rows="5">
            </textarea>
      </form>
</body>
</html>