It may be easer to do that in PHP:
$val = round(value('D221_13'));
put('D221_14', $val);
If you like to do that in JavaScript, you will have to drag the question D221 (at least with the variables 13 und 14) on the page above the JavaScript. And, of course, you need to read from the internal variable:
var scoreA = document.getElementById("D221_13");
var scoreB = document.getElementById("D221_14");
scoreB.value = Math.round(parseFloat(scoreA.value));
but ... better use the PHP code, no need to move that from the server to the browser.