Design Mode

Browser’s Developer Tools Right-click anywhere within the browser screen. Click on Inspect or Inspect Element. Type into the console: document.designMode = “on” Result The webpage turns into an editable webpage. To cancel the editable mode, type in “off” instead of “on”. Simply refresh the page and the page will go back to normal.

Toggle Password Input

HTML <input id=”&quot;password-input&quot;” type=”&quot;password&quot;” /> <button class=”&quot;toggle-password&quot;”>Toggle PW</button> JavaScript // Select the Password Input Field const passwordInput = document.querySelector( “#password-input” ); // Select the Show / Hide Password Button const togglePasswordButton = document.querySelector( “.toggle-password” ); togglePasswordButton.addEventListener( “click”, () => { // Check for the current type of the input if( passwordInput.type === “password” ) {…

Math.random()

Olivia Emma Charlotte Amelia Ava Sophia Isabella Mia Evelyn Harper HTML Names taken off The Bump. <ul> <li class=”listed-names”>Olivia</li> <li class=”listed-names”>Emma</li> <li class=”listed-names”>Charlotte</li> <li class=”listed-names”>Amelia</li> <li class=”listed-names”>Ava</li> <li class=”listed-names”>Sophia</li> <li class=”listed-names”>Isabella</li> <li class=”listed-names”>Mia</li> <li class=”listed-names”>Evelyn</li> <li class=”listed-names”>Harper</li> </ul> JavaScript function pickWinner( num ) { let win = Math.floor( Math.random() * num ); let dinner =…

Go Back

HTML <button>Go Back</button> JavaScript function goBack() { window.history.back(); } Result Click me to go back one webpage based on your web browser’s history.