<html> <head> <script> function myFunction() { setInterval(displayFunction,3000); } function displayFunction() { document.getElementById("para").innerHTML+="<p>Welcome to javascript</>"; } </script> </head> <body> <p>Click to set The Time Interval</p> <input type="button" value="Set Time Interval" onclick="myFunction();"/> <p id="para"></p> </body> </html>