I want the result to appear written next to the button as a < p > and then decorate everything with css but I don't know how to make it appear written without resetting the entire page (documen.write) or without a dialog box appearing ( alert)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
</title>
</head>
<body>
<input type="text" name="nota1">
<input type="text" name="nota2">
<button onclick="sub()">Prueba</button>
<script>
function sub(){
nota1 = document.getElementsByName("nota1")[0].value;
nota2 = document.getElementsByName("nota2")[0].value;
var total= Number(nota1) + Number(nota2);
alert (total);
}
</script>
</body>
</html>
With a label it can be.