Wednesday, 20 August 2014

button java

<html>

<title>java script</title>
<script>
function abc()
{
document.getElementById("check").align="left";}

function abc1()
{
document.getElementById("check").align="center";}

function abc2()
{
document.getElementById("check").align="right";}
function abc3()
{
document.getElementById("check1").color="red";}
function abc4()
{
document.getElementById("check1").color="blue";}
function abc5()
{
document.getElementById("check1").color="pink";}


</script>

</head>

<body>
<h1 id="check"><font id="check1">java script</font></h1>
<button onClick="abc()">left</button>
<button onClick="abc1()">center</button>
<button onClick="abc2()">right</button>
<button onClick="abc3()">red</button>
<button onClick="abc4()">blue</button>
<button onClick="abc5()">pink</button>

</body>
</html>

Tuesday, 19 August 2014

good work

<html>
<head>
<title>Result Card</title>

<script>
sr=1;

rollno=prompt("Type Your RollNo","");
name=prompt("Type Your Name","");
english=prompt("Type Your English Marks","");
math=prompt("Type Your Math Marks","");
urdu=prompt("Type Your Urdu Marks","");
total=300;
obtained=eval(english)+eval(math)+eval(urdu);
percentage=obtained*100/total;

if(percentage>30)
{
ans="Pass";
}
else
{
ans="Fail";
}

check=confirm("Are You Sure");
if(check==true)
{
document.write("<tabke>");
}
else
{
document.write("Result Not found");
}

document.write(check);
</script>
</head>
<!--
<body>
<h1 align="center">Result Card</h1>
<table border="1" width="400" align="center">

<tr>
<td width="100">Sr#</td>
<td><script>document.write(sr);</script></td>
</tr>

<tr>
<td>Roll No</td>
<td><script>document.write(rollno);</script></td>
</tr>

<tr>
<td>Name</td>
<td><script>document.write(name);</script></td>
</tr>


<tr>
<td>English</td>
<td><script>document.write(english);</script></td>
</tr>


<tr>
<td>math</td>
<td><script>document.write(math);</script></td>
</tr>

<tr>
<td>urdu</td>
<td><script>document.write(urdu);</script></td>
</tr>

<tr>
<td>Total Marks</td>
<td><script>document.write(total);</script></td>
</tr>

<tr>
<td>Obtained Marks</td>
<td><script>document.write(obtained);</script></td>
</tr>

<tr>
<td>Percentage</td>
<td><script>document.write(percentage);</script></td>
</tr>

<tr>
<td>Pass/Fail</td>
<td><script>document.write(ans);</script></td>
</tr>
</table>
</body>
-->
</html>

paste copy

<html>
<head>
<title>Result Card</title>
<script>

alert("welcome to Result card");
stname=prompt("Please Type Your Name","");
rollno=prompt("Please Type Your Rollno","");
english=prompt("Please Type Your English Marks","");
urdu=prompt("Please Type Your Urdu Marks","");
check=confirm("Are You Sure");
if(check==true)
{
document.write("<table border='1' width='400' align='center'><tr><td>Name</td><td>" + stname +" </td></tr><tr><td>RollNo</td><td>" + rollno +" </td></tr><tr><td>English</td><td>" + english +" </td></tr></table>");
}
else
{
document.write("Result Not found");
}



</script>
</head>
<body>

</body>
</html>

Sunday, 17 August 2014

java script

<html>
<head>
<title>java script</title>
<script>
a="Asif";
c=20359;
f=80;
h=65;
j=55;
total=300;
ob=h+f+j;
per=ob*100/total;
if(per>50)
{
ans="pass";
}
else
{ans="fail";
}
alert("welcome")
confirm("are you sure")
prompt("text")
</script>
</head>
<body>
<h1 align="center"><font color="#FF00FF">Result Card</font></h1>
<table border="1" height="" width="400" align="center">
<tr>
<td width="100">Name</td>
<td><script>document.write(a)</script></td>
</tr>
<tr>
<td width="100">Roll No</td>
<td><script>document.write(c)</script></td>
</tr>
<tr>
<td width="100">Urdu</td>
<td><script>document.write(f)</script></td>
</tr>
<tr>
<td width="100">English</td>
<td><script>document.write(h)</script></td>
</tr>
<tr>
<td width="100">Math</td>
<td><script>document.write(j)</script></td>
</tr>
<tr>
<td width="100">Total</td>
<td><script>document.write(total)</script></td>
</tr>
<tr>
<td width="100">obtained marks</td>
<td><script>document.write(ob)</script></td>
</tr>

<tr>
<td width="100">Percentage</td>
<td><script>document.write(per)</script></td>
</tr>
<tr>
<td width="100">Pass/Fail</td>
<td><script>document.write(ans)</script></td>
</tr>
</table>
</body>
</html>

Thursday, 10 July 2014

div

<html>
<head>
<title>Fashion</title>
<style>
body
{
background-color:yellow;
}
#maindiv
{
width:990px;
height:1000px;
border:1px solid black;
margin-left:auto;
margin-right:auto;
position:relative;
background-color:red;
}
#banner
{
width:990px;
height:170px;
border:1px solid black;
position:absolute;
background-color:green;}
#menu
{
width:990px;
height:60px;
border:1px solid black;
position:absolute;
background-color:blue;
margin-top:170px;
}
</style>
</head>
<body>
<div id="maindiv">
<div id="banner">
<img src="images/banner.jpg" width="990" height="170"><img>
</div>
<div id="menu"></div>

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