In this scenario the existing code listens to a click on the button. When the button is clicked, the function changeInput is triggered. changeInput tries to select an input field with id inputEl. But, the existing input field does not have this id. Add some Javascript code to add the id inputEl to the existing input field.Verify that your code works by clicking the button.

HTML snippet

<div id="wrapper">
<input type="text" placeholder="Text" readonly/>
<button type="button">Click Me</button>
</div>

JavaScript snippet

const wrapper = document.getElementById('wrapper');
const inputElem = wrapper.querySelector('input');
const buttonElem = wrapper.querySelector('button');

buttonElem.addEventListener('click', () => {
  // complete the code snippet
});

Preview

Screenshot 2025-04-17 121516.png