for (var inp=1;inp<=5;inp++) {

    const div1 = document.getElementById("op_HBZ010_"+inp);
    const div2 = document.getElementById("op_HBZ010_"+inp).parentNode.firstChild.firstChild.firstChild.firstChild.firstChild;
    document.getElementById("ct_HBZ010_"+inp).style.display="none";
    div1.after(div2);
}
$( document ).ready(function() {
    console.log( "ready!" );
    var summe = 0;
    for (var inp=1;inp<=5;inp++) {
        var posvalue=0;
        if (isNaN(parseInt($("#op_HBZ010_"+inp).val()))) { 
        } else {
            posvalue = parseInt($("#op_HBZ010_"+inp).val());
        }
        summe = summe +posvalue;
    }
    var rest = 10-summe;
    $("#rest").html(rest);
    $("#rest").css("color", "black");
    if (rest<0) $("#rest").css("color", "red");
});

$( "input" ).on(
    "change", // Bind handlers for multiple events
    function() {
        var summe = 0;
        for (var inp=1;inp<=5;inp++) {
            var posvalue=0;
            if (isNaN(parseInt($("#op_HBZ010_"+inp).val()))) { 
                $("#op_HBZ010_"+inp).val("");
            } else {
                $("#op_HBZ010_"+inp).val(parseInt($("#op_HBZ010_"+inp).val()));
                posvalue = parseInt($("#op_HBZ010_"+inp).val());
            }
            summe = summe +posvalue;
        }
        var rest = 10-summe;
        $("#rest").html(rest);
        $("#rest").css("color", "black");
    if (rest<0) {
        $("#rest").css("color", "red");
        alert("Es sollen (maximal) 10 Punkte verteilt werden!");
    }
    }
);