Merge 4315a798bc
into 09f408a1b7
commit
2c6c4977ec
@ -0,0 +1,55 @@
|
|||||||
|
let arr = [];
|
||||||
|
console.log(arr);
|
||||||
|
let secondArr = [5, 4, 3, 2, 1];
|
||||||
|
secondArr.sort();
|
||||||
|
console.log(secondArr);
|
||||||
|
|
||||||
|
let check = 1;
|
||||||
|
|
||||||
|
function tryingHere() {
|
||||||
|
const trying = "This is Ashish Bhoya";
|
||||||
|
const MikeRoss = "This is legendary Mike Ross";
|
||||||
|
if (check === 1)
|
||||||
|
document.getElementById("Ok").innerHTML = trying, check = 0;
|
||||||
|
else
|
||||||
|
document.getElementById("Ok").innerHTML = MikeRoss, check = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function table() {
|
||||||
|
let num = document.getElementById("input").value;
|
||||||
|
document.getElementById("tableHere").innerHTML = "";
|
||||||
|
for (let i = 1; i <= 10; i++) {
|
||||||
|
document.getElementById("tableHere").innerHTML += `${num} * ${i} = ${num * i} <br>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const MANGA = ["Meta", "Apple", "Netflix", "Google", "Amazon"];
|
||||||
|
|
||||||
|
function checkFAANG() {
|
||||||
|
let input = document.getElementById("company").value;
|
||||||
|
let check = false;
|
||||||
|
for (let i = 0; i < MANGA.length; i++) {
|
||||||
|
if (input.toUpperCase() === MANGA[i].toUpperCase()) {
|
||||||
|
check = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (check) {
|
||||||
|
document.getElementById("result").innerHTML = "Yes this is in FAANG";
|
||||||
|
}
|
||||||
|
else document.getElementById("result").innerHTML = "No this is not in FAANG";
|
||||||
|
}
|
||||||
|
|
||||||
|
function personalInfo() {
|
||||||
|
let firstName = document.getElementById("firstName").value;
|
||||||
|
let lastName = document.getElementById("lastName").value;
|
||||||
|
let age = document.getElementById("age").value;
|
||||||
|
let address = document.getElementById("address").value;
|
||||||
|
let city = document.getElementById("city").value;
|
||||||
|
let state = document.getElementById("state").value;
|
||||||
|
let zip = document.getElementById("zip").value;
|
||||||
|
let country = document.getElementById("country").value;
|
||||||
|
let phone = document.getElementById("phone").value;
|
||||||
|
let email = document.getElementById("email").value;
|
||||||
|
document.getElementById("personalInfo").innerHTML = `First Name: ${firstName} <br> Last Name: ${lastName} <br> Age: ${age} <br> Address: ${address} <br> City: ${city} <br> State: ${state} <br> Zip: ${zip} <br> Country: ${country} <br> Phone: ${phone} <br> Email: ${email}`;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
<!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>
|
||||||
|
<script src = "first.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
This is Ashish just doing some random stuff.
|
||||||
|
This is the array.
|
||||||
|
<div id = "Ok">
|
||||||
|
This is the current content.
|
||||||
|
</div>
|
||||||
|
<button onclick="tryingHere()">Press me</button>
|
||||||
|
<input type="text" id="input" placeholder="Enter the number here"> </input>
|
||||||
|
<button onclick = "table()" id = "table"> Click here to print the table of the Number Typed</button>
|
||||||
|
<div id = "tableHere"> Here the Table will get printed once the number is entered </div>
|
||||||
|
<div style="padding-top: 30px;" > Check if the company belongs FAANG</div>
|
||||||
|
<input type="text" id="company" placeholder="Enter the company name here"> </input>
|
||||||
|
<button onclick = "checkFAANG()" id = "check"> Click here to check if the company belongs to FAANG</button>
|
||||||
|
<div id = "result"> Here the result will get printed once the company is entered </div>
|
||||||
|
|
||||||
|
<div style="padding-top: 30px;" > Personal Info </div>
|
||||||
|
<input type="text" id="firstName" placeholder="Enter your first name here"> </input>
|
||||||
|
<input type="text" id="lastName" placeholder="Enter your last name here"> </input>
|
||||||
|
<input type="text" id="age" placeholder="Enter your age here"> </input>
|
||||||
|
<input type="text" id="email" placeholder="Enter your email here"> </input>
|
||||||
|
<input type="text" id="phone" placeholder="Enter your phone number here"> </input>
|
||||||
|
<input type="text" id="address" placeholder="Enter your address here"> </input>
|
||||||
|
<input type="text" id="city" placeholder="Enter your city here"> </input>
|
||||||
|
<input type="text" id="state" placeholder="Enter your state here"> </input>
|
||||||
|
<input type="text" id="zip" placeholder="Enter your zip code here"> </input>
|
||||||
|
<input type="text" id="country" placeholder="Enter your country here"> </input>
|
||||||
|
<button onclick = "personalInfo()" id = "personal"> Click here to print the personal info</button>
|
||||||
|
<div id = "personalInfo"> Here the personal info will get printed once the info is entered </div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in new issue