Definition :
Strict mode forces user to declare the variables in the program.
Program :
<html>
<head>
<script language=”javascript”>
var a,b;
function display()
{
“use strict”;
//do add;
a=document.getElementById(“dd”);
b=document.createElement(“input”);
b.setAttribute(“type”,”text”);
b.setAttribute(“id”,”t1″);
a.appendChild(b);
}
</script> </head>
<body>
<div id=”dd”> </div> </br>
<input type=”button” value=”Add” onClick=”display()”/> </br>
</body>
</html>
Be First to Comment