You are on page 1of 3

Practica 9

/* 1.Write a program to use intrinsic functions in JavaScript*/

<html>
<head><title>INTRINSIC FUNCTIONS</title></head>
<body>
<form name="frm1" action="" method="post">
<p><b>Name : </b><input type="text" name="t1"
id="t1"> <br>
<b>Age : </b><input type="text" name="t2" id="t2">
<br>
<img src="submit.jpg" height="80" width="80"
onclick="javascript:document.forms.frm1.submit()"/>

<img src="reset.jpg" height="80" width="80"


onclick="javascript:document.forms.frm1.reset()"/>
</p>
</form>
</body>
</html>
Practica 9

/* 2. Write a program to show use of read-only and disabling


elements */

<html>
<script lang="Javascript" type="text/javascript">
function readonly_element()
{
document.forms.frn1.t1.readOnly = true;
}

function enter()
{
document.forms.t1.readOnly = false;
}

function disable_elemnt()
{
document.forms.frn1.t1.disabled = true;
}

function enable_element()
{
document.forms.frn1.t1.disabled = false;
}
</script>
<body>
<form name="frn1">
<h3>READONLY</h3>
<b>Enter Your Name :</b><input type="text"
name="t1" id="t1"><br><br>

<input type="button" value="Read Only"


onclick="readonly()">

<input type="button" value="Write"


onclick="enter()"> <br><br>

<h3>DISABLE</h3>
Practica 9

<b>Enter City :</b><input type="text" name="t1"


id="t1"><br><br>
<input type="button" value="Disable"
onclick="disable_element()">
<input type="button" value="Enable"
onclick="enable_element()">
</form>
</body>
</html>

You might also like