Javascript Essentials.txt - *TCS Internal Random Charecter...

This preview shows page 1 - 2 out of 3 pages.

//*****TCS Internal******* ------------ Random Charecter ------------ function stringGen() { var text = ""; var lgth=document.getElementById('num').value; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var i = 0; i < lgth; i++){ text += possible.charAt(Math.floor(Math.random() * possible.length)); } document.getElementById("result").innerText =text; return text; } ------------ Fibanacci Series ------------ function fibonacciSequence(input) { //Type your code here. if (input===1) { return [0, 1]; } else { var s = fibonacciSequence(input - 1); s.push(s[s.length - 1] + s[s.length - 2]); return s; } } ------------ DOM - User Registration Details ------------ function myFunction() { // type your code here. return document.getElementById("myname").value+","+document.getElementById("myphone").valu e+","+document.getElementById("mycontry").value+","+document.getElementById("mymail ").value } ------------ DOM - Create Drop Down Country Field ------------ function runList(){ //Type your code here. var x = document.getElementById("list"); var option = document.createElement("option"); option.text = document.getElementById('txtbox').value; x.add(option); } ------------ Simple Calculator ------------ ------ HTML -------------- <HEAD> <TITLE> Simple Calculation</TITLE> </HEAD> <BODY>
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read all 3 pages?

  • Fall '19
  • Sociology, Return statement, var text

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture