View Mode
Q: 18
A developer creates a simple webpage with an input field. When a user enters text in the inputfield and clicks the button, the actual value of the field must be displayed in the console. Here is the HTML file content: The developer wrote the javascript codebelow: Const button = document.querySelector(‘button’); button.addEvenListener(‘click’, () => ( Const input = document.querySelector(‘input’); console.log(input.getAttribute(‘value’)); When the user clicks the button, the output is always “Hello”. What needs to be done make this code work as expected?
Options
Question 18 of 30

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