Vous êtes sur la page 1sur 18

MENU:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>


<META http-equiv="Content-Type" content="text/html"; charset=utf-8">
</head>
<body>
<div>
<div>
<div>
<div>
<a href="#0.1_imgdrop"> <img src="C:\Users\Swetha\Music\audio\converted\pink-color-makes-youweaker-672x372.jpg" height="50" width="50"> </a>
<ul>
<li> <a href="#0.1_">Home <a></a></a></li>
<li> <a href="#0.1_">About Us<a></a></a></li>
<li> <a href="#0.1_">Designs and cost<a></a></a></li>
<li> <a href="#0.1_">Comments<a></a></a></li>
</ul>
</div>
</div>
</div>
</div>
</body></html>

GUESS THE NO.


<FORM onSubmit="" NAME="guessquiz">
<CENTER>
<FONT COLOR="black" FACE="Arial"><B>GUESS MY NUMBER (1 - 100)</B></FONT>
<CENTER>
<INPUT TYPE="text" NAME="prompt" SIZE="31" MAXLENGTH="40" VALUE="Guess my number (from 1
to 100)"><BR>
<INPUT TYPE="text" NAME="guess" SIZE="3" MAXLENGTH="3" VALUE="">
<INPUT TYPE="button" VALUE="Guess" onClick='process(guessme)'>
</CENTER>
</CENTER>
</FORM>
<SCRIPT LANGUAGE="JavaScript">
var guessme=Math.round(Math.random()*(99)+1);
var speech='Guess my number (from 1 to 100)';
function process(mystery) {
var guess=document.forms.guessquiz.guess.value;
var speech='"'+guess+ '" does not make sense to me.';
document.forms.guessquiz.guess.value='';
if (guess==mystery)
{
document.forms.guessquiz.prompt.value='Congratulations! '+mystery+' is correct!';
alert ('Well done - the mystery number is '+mystery+'! \n\nPress this button to reload the page for
another game.');
speech='';
document.location=document.location;}

if (mystery<guess)
{
speech='Less than '+ guess;
}

if (mystery>guess)
{
speech='Greater than '+ guess;
}

if (guess=='')
{
speech='You didn\'t guess anything!'
}

document.forms.guessquiz.prompt.value=speech; document.forms.guessquiz.guess.focus();

}
</SCRIPT>

CONFIRMATION BOX
<!doctype html>
<html>
<head>
<title>CONFIRM</title>
</head>
<body>
<a href="www.google.co.in" onclick=alertmsg()> Google </a>
<script>
function alertmsg()
{
window.confirm("Do you Want to continue?")
}
</script>
</body>
</html>

PALINDROME
<html>
<body>
<script type="text/javascript">
function checkPalindrome() {
var revStr = "";
var str = document.getElementById("str").value;
var i = str.length;
for(var j=i; j>=0; j--) {
revStr = revStr+str.charAt(j);
}
if(str == revStr) {
alert(str+" -is Palindrome");
} else {
alert(str+" -is not a Palindrome");
}
}
</script>
<form >
Enter a String/Number: <input type="text" id="str" name="string" /><br />
<input type="submit" value="Check" onclick="checkPalindrome();"/>
</form>
</body>
</html>

CALCULATOR
<!doctype html>
<html>
<head>

<title> REAL CALCULATOR </title>


<body bgcolor="black" font="gold">
<form name="calculator">

<input type="button" value="1" onclick="document.calculator.ans.value +='1'">


<input type="button" value="2" onclick="document.calculator.ans.value +='2'">
<input type="button" value="3" onclick="document.calculator.ans.value +='3'">
<input type="button" value="+" onclick="document.calculator.ans.value +='+'">

<input type="button" value="4" onclick="document.calculator.ans.value +='4'">


<input type="button" value="5" onclick="document.calculator.ans.value +='5'">
<input type="button" value="6" onclick="document.calculator.ans.value +='6'">
<input type="button" value="-" onclick="document.calculator.ans.value +='-'">

<input type="button" value="7" onclick="document.calculator.ans.value +='7'">


<input type="button" value="8" onclick="document.calculator.ans.value +='8'">
<input type="button" value="9" onclick="document.calculator.ans.value +='9'">
<input type="button" value="*" onclick="document.calculator.ans.value +='*'">
<input type="button" value="/" onclick="document.calculator.ans.value +='/'">

<input type="reset" value="reset">


<input type="button" value="=" onclick="document.calculator.ans.value
+=eval(document.calculator.ans.value)">

</form>
</body>
</html>

SIMPLE CALCULATOR
<!doctype html>
<html>

<body>

<form name="form1">

<input type="number" name="v1">1num<br>


<input type="number" name="v2">2num<br>

<input type="button" name="add" value="+" onclick="add()">


<input type="button" name="sub" value="-" onclick="sub()">
<input type="button" name="mult" value="*" onclick="mult()">
<input type="button" name="div" value="/" onclick="div()">

<input type="button" name="calculate" value="=" onclick="total()">

<input type="number" name="total">


<input type="reset" value="reset">

</form>

<script>

function add()
{
var a,b,total;
a=document.form.v1.value;
b=document.form.v2.value;
total=a+b;
total=document.form.total.value;
}

function sub()
{
var a,b,total;
a=document.form.v1.value;
b=document.form.v2.value;
total=a-b;
total=document.form.total.value;
}

function mult()
{
var a,b,total;
a=document.form.v1.value;
b=document.form.v2.value;
total=a*b;
total=document.form.total.value;
}

function div()
{
var a,b,total;
a=document.form.v1.value;
b=document.form.v2.value;
total=a/b;
total=document.form.total.value;
}

function total()
{
window.write("total");
}

</script>

</body>
</html>

SUBJECT MARKS
<!doctype html>
<html>
<head>
</head>
<body>
<form name=f1>
<input type=text name=stuname> name </br>
<input type=number name=sub1> sub1 </br>
<input type=number name=sub2> sub2 </br>
<input type=number name=sub3> sub3 </br>
<input type=number name=sub4> sub4 </br>
<input type=number name=sub5> sub5 </br>
<input type=number name=total> total </br>
<input type=text name=result> result </br>
<input type=button name=calculate value="calculate" onclick=total()>
</form>
<script>
fuction total()
{
var a,b,c,d,e,name,total;
name=document.f1.stuname.value;
a=document.f1.sub1.value;

b=document.f1.sub2.value;
c=document.f1.sub3.value;
d=document.f1.sub4.value;
e=document.f1.sub5.value;
total=a+b+c+d+e;
total=document.f1.total.value;
}

if (a>50&&b>50&&c>50&&d>50&&e>50)
{
result="pass";
result=document.f1.result.value;
}
else
{
result="fail";
result=document.f1.result.value;
}
</script>
</body>
</html>

1&3
<!doctype html>
<html>

<body>

<button onmouseover="myFunction()">POPUP</button>

<script>
function myFunction() {
var a = window.open("", "", "width=200,height=100");
var b = prompt("Name");
var c = prompt("What has a foot but no legs?");
var d="snail";
var e=b+" "+"your answer is correct";
var f=b+" "+"Wrong answer,The correct answer is snail";
if(c==d)
{alert(e);}
else{
alert(f);}
}
</script>

</body>
</html>

2
<!DOCTYPE html>
<html>
<head>
<title>Cycling Banner</title>
<script>
window.onload = rotate;

var theAd = 0;
var adImages = new Array("banner1.jpg","banner3.jpg","banner2.jpg","banner4.jpg","banner5.jpg");
var Link = new
Array("https://www.youtube.com/?gl=IN","https://www.google.co.in/?gfe_rd=cr&ei=FEmWVNzjO6XM8
geeioHAAg&gws_rd=ssl","https://www.facebook.com/?stype=lo&jlou=AfegTmi57PSYXUx4Ya7zdARTOVuj4_PSfRKPgC-uifHLloFbAPwIA46MOiOO-3GSpe84DUFYm02eXna_Qnlk7zdACFfHrZkDbiPDrVvBh5w&smuh=1554&lh=Ac89BHacJaa6bNuD&aik=XfpVtS4DLMu9tGiSf41BxQ","http://www.airtel.in/smartby
te-s/page.html","https://in.yahoo.com/");

function rotate() {
theAd++;
if (theAd == adImages.length) {
theAd = 0;
}
document.getElementById("adBanner").src = adImages[theAd];

document.getElementById("link").href = Link[theAd];

setTimeout(rotate, 5000);
}

</script>
</head>
<body>
<div>
<center>
<a href="google.com" id="link"><img src="banner1.jpg" id="adBanner" alt="Ad Banner"
height="500px" width="500px"> </a>

</center>
</div>
</body>
</html>

4 time
<!doctype html>
<html>
<head>
<script>
function startTime() {
var today = new Date();

var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById('txt').innerHTML =
h + ":" + m + ":" + s;
var t = setTimeout(startTime, 500);
}
function checkTime(i) {
if (i < 10) {i = "0" + i}; // add zero in front of numbers < 10
return i;
}
</script>
</head>

<body onload="startTime()">

<div id="txt"></div>

</body>
</html>

BUTTONS
<!doctype html>
<html>

<body id="color">

<button onclick="but1()">NEW WINDOW</button>


<button onclick="but2()">CLOSE WINDOW</button>
<button onclick="but3()">CLOSE THIS WINDOW</button>
<button onclick="but4()">RED</button>
<button onclick="but5()">BLUE</button>
<button onclick="but6()">GREEN</button>
<script>
var a,b;

function but1()
{
a = window.open("", "", "width=500,height=100");
}
function but2()

{
a.close();
}
function but3()
{
b=window.close("5.html");
b.close();
}
function but4()
{
document.body.style.backgroundColor = "red";
}
function but5()
{
document.body.style.backgroundColor = "blue";
}
function but6()
{
document.body.style.backgroundColor = "green";
}
</script>
</body>

</html>

Vous aimerez peut-être aussi