Ticker

6/recent/ticker-posts

JavaScript (Important Programs)

JavaScript Program To Increase Font Size Dynamically  

<html>
<title> Change font size of text line at run time </title>
<body>
<form name="f">
<font size="5" id="fs"> Welcome in aptech computer education</font>
<br> <br>
Enter font size: <input type="text" size="5" name="s">
<input type="button" value="Submit" onClick="size1()">
</body>

<script>
function size1()
{
var s;
s=Number(f.s.value);
document.getElementById("fs").size=s;
}
</script>
</html>


<html>
<title>  A simple game by MouseMove event </title>
<body>

<h1 align="center"> Catch just one button and win Rs. 100 </h1>
<form name="f">
<pre>
<input type="button" value="Catch me 1" id="b1" onmousemove="abc()">

<br> <br> <br> <br> <br>


<input type="button" value="Catch me 2" id="b2" onmousemove="xyz()">
</pre>
</form>

<script>
function abc()
{
document.getElementById("b1").style.visibility="Hidden";
document.getElementById("b2").style.visibility="visible";
}

function xyz()
{
document.getElementById("b1").style.visibility="visible";
document.getElementById("b2").style.visibility="Hidden";
}
</script>

</body>
</html>


<html>
<title>  An example of Load event </title>
<body onLoad="hide()">

<form name="f">
<pre>
<font size="+2">
<b>Items Quantity </b>
<input type="checkbox" onClick="show()"> 1. Coffee Rs. 40 <input type="text" size="4" id="tea">
</font>
</pre>
</form>
</body>

<script>
function hide()
{
document.getElementById("tea").style.visibility="Hidden";
}

function show()
{
document.getElementById("tea").style.visibility="visible";
}
</script>






Post a Comment

0 Comments