What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-26 04:03:05
difference between key and code in javascript
// Key -> if you care about the character which was typed // Code -> if you care about the key which was pressed on the keyboard because your can change the language on your pc. const input = document.querySelector("input"); input.addEvent... Add solution -
Javascript 2021-09-23 21:17:04
DocumentFragment
var list = document.querySelector('#list') var fruits = ['Apple', 'Orange', 'Banana', 'Melon'] var fragment = new DocumentFragment() fruits.forEach(function (fruit) { var li = document.createElement('li') li.innerHTML = fruit fragment.appendChild(... Add solution -
Other 2021-09-23 20:30:02
request optional permission in chrome extension
document.querySelector('#my-button').addEventListener('click', function(event) { // Permissions must be requested from inside a user gesture, like a button's // click handler. chrome.permissions.request({ permissions: ['tabs'], origins: ['http://... Add solution -
Javascript 2021-09-23 15:37:04
tip in js
document.querySelector('#tip-form').onchange = function(){ var bill = Number(document.getElementById('billTotal').value); var tip = document.getElementById('tipInput').value; document.getElementById('tipOutput').innerHTML = `${tip}%`; var tipValu... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5