<html>
<head>
<title>
simple quiz test
</title>
<h1><font color = "green">only 10 question !!! Each answer carry 5 marks ..ALL THE BEST !!! </font></h1>
<p><font color = "blue">U should every Question ..</font> </p>
</head>
<script type = "text/javascript">
function firstAnswer()
{
for (i=0 ; i<document.first.quiz.length ; i++)
{
if (document.first.quiz[i].checked==true)
{
var t = document.first.quiz[i].value
}
}
if (t == "1" )
{
document.getElementById("txt1").value = "5"
}
else {
document.getElementById("txt1").value = "0"
}
var item = document.getElementById("two");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("one");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function secondAnswer()
{
for (i=0 ; i<document.second.quiz.length ; i++)
{
if (document.second.quiz[i].checked==true)
{
var t = document.second.quiz[i].value
}
}
if (t == "2" )
{
document.getElementById("txt2").value = "5"
}
else {
document.getElementById("txt2").value = "0"
}
var item = document.getElementById("three");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("two");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function thirdAnswer()
{
for (i=0 ; i<document.third.quiz.length ; i++)
{
if (document.third.quiz[i].checked==true)
{
var t = document.third.quiz[i].value
}
}
if (t == "1" )
{
document.getElementById("txt3").value = "5"
}
else {
document.getElementById("txt3").value = "0"
}
var item = document.getElementById("four");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("three");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function fourAnswer()
{
for (i=0 ; i<document.four.quiz.length ; i++)
{
if (document.four.quiz[i].checked==true)
{
var t = document.four.quiz[i].value
}
}
if (t == "3" )
{
document.getElementById("txt4").value = "5"
}
else {
document.getElementById("txt4").value = "0"
}
var item = document.getElementById("five");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("four");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function fiveAnswer()
{
for (i=0 ; i<document.five.quiz.length ; i++)
{
if (document.five.quiz[i].checked==true)
{
var t = document.five.quiz[i].value
}
}
if (t == "2" )
{
document.getElementById("txt5").value = "5"
}
else {
document.getElementById("txt5").value = "0"
}
var item = document.getElementById("six");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("five");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function sixAnswer()
{
for (i=0 ; i<document.six.quiz.length ; i++)
{
if (document.six.quiz[i].checked==true)
{
var t = document.six.quiz[i].value
}
}
if (t == "1" )
{
document.getElementById("txt6").value = "5"
}
else {
document.getElementById("txt6").value = "0"
}
var item = document.getElementById("seven");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("six");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function sevenAnswer()
{
for (i=0 ; i<document.seven.quiz.length ; i++)
{
if (document.seven.quiz[i].checked==true)
{
var t = document.seven.quiz[i].value
}
}
if (t == "2" )
{
document.getElementById("txt7").value = "5"
}
else {
document.getElementById("txt7").value = "0"
}
var item = document.getElementById("eight");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("seven");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function eightAnswer()
{
for (i=0 ; i<document.eight.quiz.length ; i++)
{
if (document.eight.quiz[i].checked==true)
{
var t = document.eight.quiz[i].value
}
}
if (t == "1" )
{
document.getElementById("txt8").value = "5"
}
else {
document.getElementById("txt8").value = "0"
}
var item = document.getElementById("nine");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("eight");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function nineAnswer()
{
for (i=0 ; i<document.nine.quiz.length ; i++)
{
if (document.nine.quiz[i].checked==true)
{
var t = document.nine.quiz[i].value
}
}
if (t == "3" )
{
document.getElementById("txt9").value = "5"
}
else {
document.getElementById("txt9").value = "0"
}
var item = document.getElementById("ten");
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
var item = document.getElementById("nine");
if (item) {
item.className=(item.className=='unhidden')?'hidden':'unhidden';
}
}
function tenAnswer()
{
for (i=0 ; i<document.ten.quiz.length ; i++)
{
if (document.ten.quiz[i].checked==true)
{
var t = document.ten.quiz[i].value
}
}
if (t == "1" )
{
document.getElementById("txt10").value = "5"
}
else {
document.getElementById("txt10").value = "0"
}
var item = document.getElementById("helo");
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
function total()
{
var a = parseInt(document.getElementById("txt1").value)
var b = parseInt(document.getElementById("txt2").value)
var c = parseInt(document.getElementById("txt3").value)
var d = parseInt(document.getElementById("txt4").value)
var e = parseInt(document.getElementById("txt5").value)
var f = parseInt(document.getElementById("txt6").value)
var g = parseInt(document.getElementById("txt7").value)
var h = parseInt(document.getElementById("txt8").value)
var i = parseInt(document.getElementById("txt9").value)
var j = parseInt(document.getElementById("txt10").value)
var k = a + b + c + d + e + f + g + h + i + j
document.getElementById("txt").value = k
alert("your score is "+k+" out of 50");
}
</script>
</head>
<body>
<div id = "one" class = "unhidden">
<form name = "first" >
1) who developed this script ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >sathia<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">Ramesh<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">Gokul<br></br>
<input type = "button" value = "next" onclick = "firstAnswer()">
<input type = "hidden" id = "txt1">
</form>
</div>
<div class = "hidden" id = "two">
<form name = "second" >
2) which is full form of HTML ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >Hyprer Text Makeup language<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">HyperText MarhUp Language<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">Heavy Text Manmade Language<br></br>
<input type = "button" value = "next" onclick = "secondAnswer()">
<input type = "hidden" id = "txt2">
</form>
</div>
<div class = "hidden" id = "three">
<form name = "third" >
3) which is capital of tamil nadu ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >chennai<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">delhi<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">coimbatore<br></br>
<input type = "button" value = "next" onclick = "thirdAnswer()">
<input type = "hidden" id = "txt3">
</form>
</div>
<div class = "hidden" id = "four">
<form name = "four" >
4) which wonder is symbol of love ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >chennai central<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">nile river<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">Taj mahal<br></br>
<input type = "button" value = "next" onclick = "fourAnswer()">
<input type = "hidden" id = "txt4">
</form>
</div>
<div class = "hidden" id = "five">
<form name = "five" >
5) who is founder of LINUX ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >Abdul Kalam<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">Linus<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">Abraham Linchon<br></br>
<input type = "button" value = "next" onclick = "fiveAnswer()">
<input type = "hidden" id = "txt5">
</form>
</div>
<div class = "hidden" id = "six">
<form name = "six" >
6) what is our national Language ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >Hindi<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">English<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">Tamil<br></br>
<input type = "button" value = "next" onclick = "sixAnswer()">
<input type = "hidden" id = "txt6">
</form>
</div>
<div class = "hidden" id = "seven">
<form name = "seven" >
7) which is longest river in the world ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >Koovam<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">Nile<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">niagra<br></br>
<input type = "button" value = "next" onclick = "sevenAnswer()">
<input type = "hidden" id = "txt7">
</form>
</div>
<div class = "hidden" id = "eight">
<form name = "eight" >
8) who is creator of james Bond?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >Ian Fleming<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">James cameroon<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">Shankar<br></br>
<input type = "button" value = "next" onclick = "eightAnswer()">
<input type = "hidden" id = "txt8">
</form>
</div>
<div class = "hidden" id = "nine">
<form name = "nine" >
9) who is father of computor ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >Leonanrd paris<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">ken thomas<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">charles babbage<br></br>
<input type = "button" value = "next" onclick = "nineAnswer()">
<input type = "hidden" id = "txt9">
</form>
</div>
<div class = "hidden" id = "ten">
<form name = "ten" >
10) who developed world wide web (www) ?</br></br>
<input type = "radio" id = "a" value = "1" name = "quiz" >Tim Bernes Lee<br></br>
<input type = "radio" id = "a" value = "2" name = "quiz">charles babbage<br></br>
<input type = "radio" id = "a" value = "3" name = "quiz">Robert bosch<br></br>
<input type = "button" value = "next" onclick = "tenAnswer()" id = "helo" class = "heloo">
<input type = "hidden" id = "txt10">
</form>
<input type = "hidden" id = "txt">
<input type = "button" value = "score" onclick = "total()">
</div>
<style type = "text/css">
.hidden
{
display:none;
}
.unhidden
{
display:block;
}
</style>
</body>
</html>
copy this and save file as (.html Extension)
Regards
sathia
HTML CALCULATOR
Wednesday, October 13, 2010
Tuesday, September 7, 2010
html calculator
<html>
<head > <h1 align= "center" >Calculator<h1>
<title>CALCULATOR</title>
<table><tr height = 50 width =50 border =1>
<marquee direction = "up" onmouseover = "this.stop();" onmouseout = "this.start();">
<a href = "http://sathia27.wordpress.com" >MY BLOG</a><a href >
</br><input type = "submit" value = "CLICK ME!!" id = "new" onclick = "neww()">
</marquee>
</tr>
</table>
<script type "text/javascript">
function addition()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x+y;
}
function subtraction()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x-y;
}
function multiplication()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x*y;
}
function division()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x/y;
}
function neww()
{
alert("helo, Scientific calculator will come soon!!!!")
}
</script>
</head>
<body bgcolor = "pink">
<table bgcolor="black" border = 1 align ="center" width = 30% height = 80 >
<tr>
<td><font color = "white">FIRST VALUE</td><td><input vaule = "x" name = "first value" id ="int"></font></td></tr>
<tr><td><font color = "white">SECOND VALUE</td><td><input vaule = "y" name = "first value" id ="so"></td></tr>
<tr><td><input value = "z" name = "ans" id = "z"></td></tr>
<tr><td>
<input type = "submit" name = "add" value ='+' onclick = "addition()">
<input type ="button" name = "sub" value = "-" onclick = "subtraction()">
<input type ="button" name = "mult" value = "*" onclick = "multiplication()">
<input type ="button" name = "divi" value = "/" onclick = "division()">
</td></tr>
</table>
</body>
</html>
<head > <h1 align= "center" >Calculator<h1>
<title>CALCULATOR</title>
<table><tr height = 50 width =50 border =1>
<marquee direction = "up" onmouseover = "this.stop();" onmouseout = "this.start();">
<a href = "http://sathia27.wordpress.com" >MY BLOG</a><a href >
</br><input type = "submit" value = "CLICK ME!!" id = "new" onclick = "neww()">
</marquee>
</tr>
</table>
<script type "text/javascript">
function addition()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x+y;
}
function subtraction()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x-y;
}
function multiplication()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x*y;
}
function division()
{
var x = parseInt(document.getElementById("int").value);
var y = parseInt(document.getElementById("so").value);
document.getElementById("z").value=x/y;
}
function neww()
{
alert("helo, Scientific calculator will come soon!!!!")
}
</script>
</head>
<body bgcolor = "pink">
<table bgcolor="black" border = 1 align ="center" width = 30% height = 80 >
<tr>
<td><font color = "white">FIRST VALUE</td><td><input vaule = "x" name = "first value" id ="int"></font></td></tr>
<tr><td><font color = "white">SECOND VALUE</td><td><input vaule = "y" name = "first value" id ="so"></td></tr>
<tr><td><input value = "z" name = "ans" id = "z"></td></tr>
<tr><td>
<input type = "submit" name = "add" value ='+' onclick = "addition()">
<input type ="button" name = "sub" value = "-" onclick = "subtraction()">
<input type ="button" name = "mult" value = "*" onclick = "multiplication()">
<input type ="button" name = "divi" value = "/" onclick = "division()">
</td></tr>
</table>
</body>
</html>
Subscribe to:
Posts (Atom)