读取按钮值的代码在页面加载时立即运行。单击按钮后您需要读取值:
const button = document.getElementById("submit_button");
button.addEventListener('click', function() {
let problem = document.getElementById("problem_selector").value;
let depth = document.getElementById("depth_input").value;
console.log(depth);
console.log(problem);
});