0% found this document useful (0 votes)
43 views7 pages

Practical 2

This document contains code for three HTML/JavaScript programs: 1. A login page that takes username and password input and calls a check() function. 2. A number checking program that uses a switch statement to check a number input and alert the user. 3. A vowels checking program that logs all characters in an alphabet array except vowels to the console.

Uploaded by

Abdullah Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views7 pages

Practical 2

This document contains code for three HTML/JavaScript programs: 1. A login page that takes username and password input and calls a check() function. 2. A number checking program that uses a switch statement to check a number input and alert the user. 3. A vowels checking program that logs all characters in an alphabet array except vowels to the console.

Uploaded by

Abdullah Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Practical 2.

HTML
<!-- Shaikh Abdullah -->
<!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">
    <script src="if.js" defer></script>
    <title>Document</title>
</head>
<body>
    <h4>
        Shaikh Abdullah 1705690080
    </h4>
    <div>
        Username <input type="text" id="t1">
    </div>
    <div>
        Password <input type="text" id="t2">
    </div>
    <button onclick="check()">LOGIN</button>
</body>
</html>

JAVASCRIPT
// 2005690066
-

OUTPUT
Practical 2.2

HTML
<!-- Shaikh Abdullah -->
<!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">
    <script src="switch.js" defer></script>
    <title>Document</title>
</head>
<body>
    <h4>
        Shaikh Abdullah 1705690080
    </h4>
    <input type="text" id="num">
    <button onclick="check()">Check</button>
</body>
</html>

JAVASCRIPT
// 1705690080
function check(){
    t1 = document.getElementById("num");
    ch = parseInt(t1.value);
    switch(ch){
            case 1:
            alert("You've Entered 1");
            break;
            case 2:
            alert("You've Entered 2");
            break;
            case 3:
            alert("You've Entered 3");
            break;
            case 4:
            alert("You've Entered 4");
            break;
            case 5:
            alert("You've Entered 5");
            break;
            case 6:
            alert("You've Entered 6");
            break;
            case 7:
            alert("You've Entered 7");
            break;
            case 8:
            alert("You've Entered 8");
            break;
            case 9:
            alert("You've Entered 9");
            break;
            case 10:
            alert("You've Entered 10");
            break;
            default:
            alert("Invalid Number");
    }
}

OUTPUT
Practical 2.3
HTML
<!-- Shaikh Abdullah -->
<!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">
    <script src="vowels.js" defer></script>
    <title>Document</title>
</head>
<body>
</body>
</html>

JAVASCRIPT
// 1705690080
A =
['a','b','c','d','e','f','g','h','i','j','k','l','m',,'n','o','p','q','r','s'
,'t','u','v','w','x','y','z'];

for(i in A){
    if(A[i]=='a' || A[i]=='e' || A[i]=='i' || A[i]=='o' || A[i]=='u' ){
        continue;
    }
    console.log(A[i]);
}

OUTPUT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy