After a user takes an action, I dynamically generate this form using JavaScript:
<form id="editBookForm" onsubmit="editBookData()">
<input type="text" name="isbn" placeholder="ISBN" required />
<input type="text" name="book" placeholder="Book..." required />
<button class ="btn">Update!</button>
</form>
The function editBookData() is as follows:
function editBookData(data) {
console.log(data)
//Additional tasks here
}
I am seeking guidance on how to prevent the default submission behavior of the form and pass the form data so that it can be accessed within the editBookData() function.
Please provide solutions without using JQuery. Thank you in advance.