var Z;
var E;
Z=document.getElementById("X").value;
E=document.getElementById("Y").value;
I don't know why but I couldn't solve this problem If you run the codes, the following error appears in the console uncaught typeerror read properties of null (reading 'value')
I would double-check that the output of document.getElementById("X") and document.getElementById("Y") is what you expected. In case there's a mismatch in the ids (typos can happen), or for some other reason the getElementById can't lookup the DOM element, you'll get null as result.