Professional Documents
Culture Documents
KKJH
KKJH
<head>
<script>
function Check(){
var t1 = document.getElementById("t1").value;
var t2 = document.getElementById("t2").value;
if(t1 == t2)
alert("Both text fields are identical");
else
alert("text fields are not identical");
}
</script>
</head>
<body>
<form>
<pre>
Field 1 <input type="text" id="t1" />
Field 2 <input type="text" id="t2" /> <input type="button" value="Check" onclick="Check()" />
</pre>
</form>
</body>
Question #2-
<head>
<script>
function Check(){
var x = document.getElementById("n");
<body>
<form>
Enter a number: <input type="text" id="n" />
</form>
Question #3-
function Mul(n){
for(i=1; i<=10; i++){
document.write(i + " x " + n + " = " + i*n + "<br/>");
}
}
Question #4-
<body>
<form>
Course
<select name="courses" onchange="coef.value = this.value;">
<option value="12">JAVA</option>
<option value="10">DS</option>
<option value="14">UML</option>
<option value="12">Mobile</option>
</select>
Coef <input type="tex" name="coef" size="12" />
</form>
</body>