"use strict"; document.querySelector("#predict-form").addEventListener("submit", async (e) => { e.preventDefault(); const sequence = document.querySelector("#sequence").value; const smiles = document.querySelector("#substrate").value; console.log(sequence); const data = await prediction(sequence, smiles); document.querySelector("#km-result").innerText = data.km; document.querySelector("#kcat-result").innerText = data.kcat; document.querySelector("#vmax-result").innerText = data.vmax; }); const prediction = async (sequence, smiles) => { // send POST request with FormData const formData = new FormData(); formData.append("sequence", sequence); formData.append("smiles", smiles); const response = await fetch("/predict", { method: "POST", body: formData, }); const data = await response.json(); return data; };