showing results for - "javascript and html dom reference"
Patrice
19 Jul 2017
1const contacts = ['Chris:2232322', 'Sarah:3453456', 'Bill:7654322', 'Mary:9998769', 'Dianne:9384975'];
2const para = document.querySelector('p');
3const input = document.querySelector('input');
4const btn = document.querySelector('button');
5
6btn.addEventListener('click', function() {
7  let searchName = input.value.toLowerCase();
8  input.value = '';
9  input.focus();
10  for (let i = 0; i < contacts.length; i++) {
11    let splitContact = contacts[i].split(':');
12    if (splitContact[0].toLowerCase() === searchName) {
13      para.textContent = splitContact[0] + '\'s number is ' + splitContact[1] + '.';
14      break;
15    } else {
16      para.textContent = 'Contact not found.';
17    }
18  }
19});
queries leading to this page
how does html support dom and how do you access it 3fthe document object model javascriptdom js w3schoolsjavascript document objectexpland document using javascripthtml element diagramwhat is dom in webhtml dom referencehow to implement an html dom inside javascript with a function in javascriptlearn domjs dom to htmldom of jsdom javascript 24dom function javascriptjavascript html dom documenthtml dom and javascriptdocument object modeljavascript dom to htmlhow to implement an html dom inside javascriptwhat are dom objectsw3schools javascript html domjavascript document librarydom manipulaionwhat is the javascript domhtml dom with script jsdom w3school comwhat is dom reference in html 3fhow to place an element made in javescript on the domdom example codelearn dom javascriptdocument object model 28dom 29 in javascriptjs easy domjavascript dom referencehtml representation in javacsripthtml dom this html element reference javascriptdom documenthtml to javascript domdocument object model using javascript examplesdevelopment domdom manipuationw3schools html5 dom apijavascript to html domdom site 3aw3schools comwhat is dom in jsjavascript and html dom referencejavascript html dom syntaxusing dom to make html workhow to create document object in javascriptdom w3 schooolsthe dom htmldocument objectdocument methods javascriptthe html dom defines the objects and properties of all html elements 2c and the methods 28interface 29 to access them html js script dom tutorialdisplaying document object model treew3schoools domhtml dom preview library javascriptdom reference javascriptel dom javascriptwhat is dom document object modeldombrowser domjavascript and html domusing html dom modelhow dom works in jtmlreference html element in javascriptcreating html page using javascript dom examplescreate a html page using javascript domdocument object jshow to refer to the dom in javascriptw3schools dom manipulationjs document objectis dom related to javascript or htmljavascrip domcreate your html page via dom methods here 21 lookmanohtmldoc javasacript domjs functions domtree object modelhtml dom using javascriptdom htmlhtml document in documentwrite proprer html code for dom diagramreference dom elementhtml and js domjavascipt domhtml dom xhtml dom core dom xml domdom reference w3schholhtml to dom javascriptdocument object model in javascriptexplain dom and how is it used to link html5 and javascriptwhat is a document object modlelearn dom in javascriptdom tree in javascriptwrite html is domjs dom referencedom tutorial jshttp dom document object modeldom referencew3s domw3schools dom htmlhow to implement an html dom inside document domdom 28document object model 29dom in javascidom js functionsdom model w3schoolsdom in web developmentjavascript manipulate domdom javascript referencewhat is domjavascript can manipulate the domdom documentationjavascript and html dom reference