Category: JavaScript Questions

LocalStorage API in Javascript

A quick video tutorial about local storage api in Javascript. I hope you will like it. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <div> <input type="text" placeholder="key" id="storageKey"> <input type="text" placeholder="value" id="storageValue"> <button onclick="setStorage()">Submit</button> <button onclick="removeStorage()">Remove</button> </div> <script src="script.js"></script> </body> </html>

GeoLocation API in Javascript

In this video tutorial, you will learn how to use Geolocation api in javascript. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <button onclick="getGeoLocation()">Find My Location</button> <br><br> <div style="display:none;"> <a href="#">Click Here</a> </div> <script src="script.js"></script> </body> </html>  

Javascript Challenge #9: Autocomplete Search

This is another challenge for you guys. Its pretty simple and easy to achieve. Please try it on your own first, then watch whole video. const fruits = ['Apple', 'Orange', 'Mango', 'Watermelon', 'Kiwi', 'Banana', 'Grapes']; document.getElementById('search').addEventListener('input', (e)=>{ let fruitsArray = ; if(e.target.value){ fruitsArray = fruits.filter(fruit => fruit.toLowerCase().includes(e.target.value)); fruitsArray = fruitsArray.map(fruit => `<li>${fruit}</li>`) } showFruitsArray(fruitsArray); });