Morris,
может учебник, ссылка вверху.
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
document.addEventListener( "DOMContentLoaded" , function() {
function setNum()
{
var checked = document.querySelector("[name='Number']:checked");
document.querySelector("[name='out']").value = checked ? 10 : 5;
}
document.querySelectorAll("[name=Number]").forEach( inp => inp.addEventListener("change", setNum) )
});
</script>
</head>
<body>
<form action="http://">
<label><input type="checkbox" value="10" name="Number" >10</label>
<input type="text" name="out" value="5">
</form>
</body>
</html>