second commit

pull/133/head
11Ashish11 4 years ago
parent 5c9efd68e1
commit 2430941c33

@ -22,3 +22,22 @@ function table(){
document.getElementById("tableHere").innerHTML += `${num} * ${i} = ${num*i} <br>`; 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()){
console.log(input.toUpperCase());
console.log(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";
}

@ -17,5 +17,9 @@
<input type="text" id="input" placeholder="Enter the number here"> </input> <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> <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 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>
</body> </body>
</html> </html>
Loading…
Cancel
Save