tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code05:22

How to accept JavaScript USER INPUT in 5 minutes 💬

Bro Code ↗

From the creator

00:00:00 intro 00:00:19 window prompt 00:01:36 HTML textbox // How to accept user input // 1. EASY WAY = window prompt // 2. PROFESSIONAL WAY = HTML textbox // ------------------------- EASY WAY ------------------------- // let username = window.prompt("What's your username?"); // console.log(username); // --------------------- PROFESSIONAL WAY --------------------- let username; document.getElementById("mySubmit").onclick = function(){ username = document.getElementById("myText").value; document.getElementById("myH1").textContent = `Hello ${username}` }

Published 2023-10-15 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code