What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-28 11:45:17
get all visible text on website javascript
function isHidden(el) { var style = window.getComputedStyle(el); return ((style.display === 'none') || (style.visibility === 'hidden')) } // get the body tag var body = document.querySelector('body'); // get all tags inside body var allT... Add solution -
Javascript 2022-02-22 21:25:11
iterate over node object children
/* HTML */ /* <ul class="navigation__secondary" id="navigation-bar"> <li class="navigation__secondary-item"> <span>Item</span> </li> <li class="navigation__secondary-item active&... Add solution -
Go 2022-02-22 20:35:03
how to stop google colab from disconnecting
function ConnectButton(){ console.log("Connect pushed"); document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click() } setInterval(ConnectButton,60000); Add solution -
Javascript 2022-02-22 10:20:10
write a javascript code snippet to validate the password textbox length of minimum 8 characters.
function validateInput (textbox) { const inputLength = textbox?.value?.length || 0; if (inputLength < 8) { console.log('Invalid input: minimum 8 chars required'); document.querySelector(`label[for="${textbox.id}"]`).textContent ... Add solution -
Other 2022-02-21 13:40:11
javascript-change color onclick()
const btn = document.querySelector('button'); function random(number) { return Math.floor(Math.random() * (number+1)); } btn.onclick = function() { const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.st... Add solution -
Javascript 2022-02-19 14:20:01
how to enable click copy function using js
var copyTextareaBtn = document.querySelector('.js-textareacopybtn'); copyTextareaBtn.addEventListener('click', function(event) { var copyTextarea = document.querySelector('.js-copytextarea'); copyTextarea.focus(); copyTextarea.select(); try { ... Add solution -
Javascript 2022-02-02 22:26:23
Tic Tac Toe using html, javascript and css
const player = "O"; const computer = "X"; let board_full = false; let play_board = ["", "", "", "", "", "", "", "", ""]; const board_container ... Add solution