+ 1
Uset input
help me, you need the user to enter the name of the element and when you click on the "Find" he was shown what this element https://code.sololearn.com/WVFZE3825eD0/?ref=app
2 Réponses
+ 1
https://code.sololearn.com/WHIDA4dkbm9Y/?ref=app
+ 1
Денис Демянчук
To make the code do what you expect:
1. wrap all the JavaScript code in a function:
function search(event){
event.preventDefault();
// all your current code goes here
}
2. in the HTML add an event listener to the form to call your function:
<form onsubmit='search(event)'>....