Question: I need help with a Javascript coding assignment that has two files, a script.js file, and an index.html file. It involves using document.qeurySelector(.....); which im

I need help with a Javascript coding assignment that has two files, a script.js file, and an index.html file. It involves using "document.qeurySelector(.....);" which im not too familiar with. I will paste both the files in the space below. I'd love some advice on how to approach this problem.

Index.html is below:

Document

MAGIC NUMBER DOUBLER

?

Script.js is below and needs completed:

// fill in these two querySelectors without changing the HTML on the other document.

const input = document.querySelector(.......);

const output = document.querySelector(.......);

// for fun, remove the "defer" attribute from line 7 of the html and see what happens

// why do you think it did that?

console.log('hello from script')

function setDouble(event) {

// set value of output's innerHTML to input's value times 2

// hint: log out the "event" object to see what it actually looks like

// and research how to get the VALUE from an ELEMENT

output.innerHTML =.........

}

input.addEventListener('input', setDouble);

Please advise.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!