View Mode
Q: 1
A developer creates a simple webpage with an input field. When a user enters text and clicks the button, the actual value must be displayed in the console: HTML: JavaScript: 01 const button = document.querySelector('button'); 02 button.addEventListener('click', () => { 03 const input = document.querySelector('input'); 04 console.log(input.getAttribute('value')); 05 }); When the user clicks the button, the output is always "Hello". What needs to be done to make this code work as expected?
Options
Question 1 of 25

Premium Access Includes

  • ✓ Quiz Simulator
  • ✓ Exam Mode
  • ✓ Progress Tracking
  • ✓ Question Saving
  • ✓ Flash Cards
  • ✓ Drag & Drops
  • ✓ 3 Months Access
  • ✓ PDF Downloads
Get Premium Access
Scroll to Top

FLASH OFFER

Days
Hours
Minutes
Seconds

avail 10% DISCOUNT on YOUR PURCHASE