Web Technology Slip 3

 Q1. Write a java script program to accept a number form user and calculate and display its sum of digits. 


Answer : 

<html>
<head>
<script>
function saurabh()
{
var num,sum=0,i,str;
num = Number(document.getElementById('v').value);
str = num.toString();
for (i=0; i<str.length; i++)
{
sum += parseInt(str.charAt(i));
}
alert(sum); 
}
</script>
</head>
<input id="v">
<button onclick="saurabh()">click</button>
</html>

 Q2. Write HTML code to design a web as per given specification. Divide the browser screen into two frames. The first frame will display the heading. Divide the second frame into two columns. The frame on the left should be name of cities consisting of hyperlinks. Clicking on any one of these hyperlinks will display related information in right hand side frame as shown below.



Answer : 


File : main_fream.html


<!DOCTYPE html>  
<html>  

    <frameset rows = "30%,*">  
        <frame name = "top" src = "frame_1.html" />  
<frameset cols = "30%,*">  
        <frame name = "main" src = "frame_2.html" />  
         <frame name = "button" src = "frame.html" />  
    </frameset> 
</frameset> 

</html>              


File : frame_1.html


<html>
<title> Assignment no.4 b2</title>
<body>
<head><h1><font> IT Industries in INDIA</h1></head>
</body>
</html>


File : frame_2.html

<html>
<title>Assignment No.4 B1</title>
<body>
<ul>City
<ol type="1">
<li><a href="pune.html" target="button">Pune</a></li>
<li><a href="Mumbai.html" target="button">Mumbai</a></li>
</ol>
</ul>
</body>
</html>


File : Mumbai.html

<html>
<title> Assignment no.4 b2</title>
<body>
<ul type="square">Mumbai
<ul type="circle">
  <li style="color: #FF5733">Infosys</li>
  <li style="color:hsl(300, 100%, 70%)">Persistent</li>
  <li style="color:rgb(255, 204, 0)">Microsoft</li>
</ul>
</ul>
</html>


File : pune.html

<html>
<title> Assignment no.4 b2</title>
<body>
<ul type="square">Pune
<ul type="circle">
  <li style="color: #FF5733">Infosys</li>
  <li style="color:hsl(300, 100%, 70%)">Persistent</li>
  <li style="color:rgb(255, 204, 0)">Microsoft</li>
</ul>
</ul>
</html>              
Web Technology Slip 3 Web Technology  Slip 3 Reviewed by technical_saurabh on December 20, 2020 Rating: 5

No comments:

Powered by Blogger.