const equation = document.querySelector("p").textContent.trim(); const eq = equation.slice(0, equation.indexOf('=')-1).trim(); const answer = eval(eq); document.querySelector("input[name='uvalue']").value = answer; document.querySelector("input[type='submit']").click();