Saturday, 7 March 2020

WT-21

Q1.Write a java script code to accept the values of x and y and then display xy
<html>
<script>
function calc()
{
var t11=document.getElementById("t1").value;
var a=parseInt(t11);
var t12=document.getElementById("t2").value;
var b=parseInt(t12);
var vol=Math.pow(a,b);

document.getElementById('volume').value=vol;
}
</script>
</head>
<body>
<table border="1">
<tr><td>Enter 1 NO: </td><td><input type="text" id="t1" size="30"/></td></tr>
<tr><td>Enter 2 NO: </td><td><input type="text" id="t2" size="30"/></td></tr>
<tr><td>Result</td><td><input type="text" name="result" id="volume"></td></tr>
<tr><td> </td><td><input type="submit" value="Calculate" onclick="calc()"></td></tr>
</table>
 </body>
</html>



Q2.Write HTML code which generates the following output and display each element of list in different size, color & font. Use internal CSS to format the list.

<html>
<head>
<style>
body
{
background-color: lightblue;
}

/style>
</head>
<body>
<ul type="circle">
<li> Coffee</li>
<li> Tea </li>
&nbsp;&nbsp;<ul type="square">
&nbsp;&nbsp;&nbsp;&nbsp;<li> Black Tea </li>
<li> Green Tea</li><br>
<ol type="1">
&nbsp;&nbsp;&nbsp;<li>Africa</li>
&nbsp;&nbsp;&nbsp;  <li>China</li>
</ol>
</ul>
</body>

</html>