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:
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
Get step-by-step solutions from verified subject matter experts
