Goldengate International College: WEB Technology

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Goldengate International College

Battisputali,Kathmandu

Lab Report
WEB
TECHNOLOGY

Submitted By: SumittedTo:


Name: Namrata Shakya Department Of Computer
Grade:XII Science
Section:S13 Goldengate International
College

a. Create image gallery and implement DOM and event handling.


b. ="UTF-8">
A LAB REPORT ON WEB TECHNOLOGY

c. <!DOCTYPE html>
d. <html lang="en">
e. <head>
f.     <meta charset    <meta http-equiv="X-UA-Compatible" content="IE=edge">
g.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
h.     <title>Document</title>
i.     <script>
j.         function enlarge(id)
k.         {
l.             var img=document.getElementsByTagName('img')[id];
m.             img.height=500;
n.         }
o.         function resize(id)
p.         {
q.             var img=document.getElementsByTagName('img')[id];
r.             img.height=250;
s.         }
t.    
u.     </script>
v. </head>
w. <body>
x.     <img src="a.jpg" height="100px",onmouseover="enlarge(0)"
onmouseout="resize(0)">
y.    
z. </body>
aa.<

Output:

b.Demonstrate string object.


<!DOCTYPE html>

PREPARED BY : NAMRATA SHAKYA


A LAB REPORT ON WEB TECHNOLOGY

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var s="Golden Gate Int'l College";
        document.write ("Length:"+s.length+"<br>");
        document.write("Upper case:"+s.toUpperCase()+"<br>");
        document.write("Lower case:"+s.toLowerCase()+"<br>");
        document.write("Character at 9:"+s.charAt(9)+"<br>");
        document.write("Character Code at 14:"+s.charCodeAt(14)+"<br>");
    </script>
</body>
</html>

Output:

PREPARED BY : NAMRATA SHAKYA


A LAB REPORT ON WEB TECHNOLOGY

c.Demonstrate math object.


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        document.write("PI="+Math.PI+"<br>");
        document.write("sin(90)="+Math.sin(90*Math.PI/180)+"<br>");

    </script>
</body>
</html>

Output:

PREPARED BY : NAMRATA SHAKYA


A LAB REPORT ON WEB TECHNOLOGY

d.Demonstrate date object and user defined object.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var d= new Date(“1980/12/11”);
    document.write("month="+d.getMonth()+"<br>");
    </script>
</body>
</html>

Output:

PREPARED BY : NAMRATA SHAKYA


A LAB REPORT ON WEB TECHNOLOGY

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var a=new Object();
        a.name="Namrata";
        a.address="Chhauni";
        a.show=function()

        {
            document.write("Name="+this.name+"<br>")
            document.write("Address="+this.address+"<br>")
        }
        a.show();
    </script>
</body>
</html>

Output:

PREPARED BY : NAMRATA SHAKYA


A LAB REPORT ON WEB TECHNOLOGY

e.Demonstrate Reg Ex and Form Validation.


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
    <script>
        function check()
        {
            var name=document.getElementById('name');
            var pwd=document.getElementBypwd('pwd');
            var email=document.getElementBypwd('email');

            if(name.value=="")
            {
                alert("Name is Required");
            }
            if(pwd.value=="")
            {
                alert("Password is Required");
            }
            if(name.value=="")
            {
                alert("emailis Required");
            }

        }
    </script>
<body>
<form onsubmit"check"()>
    Name:<input type="text" name=""id=name"><br>
    Password:<input type="text" Password=""id=name"><br>
    email:<input type="text" email=""id=name"><br>
<input type="submit" value ="validate">
</form>
</body>
</form>
</html>

PREPARED BY : NAMRATA SHAKYA


A LAB REPORT ON WEB TECHNOLOGY

Output:

PREPARED BY : NAMRATA SHAKYA

You might also like