<html>
<head>
<title>
Basic Function in JavaScript
</title>
</head>
<body>
<h1>Using demo JavaScript Function</h1>
<div id="result"></div>
<script language="JavaScript">
// function creation
function demo()
{
document.getElementById("result").innerHTML = "<p>This text is added by function</p>";
}
// calling the function
demo();
</script>
</body>
</html>