$(document).ready(function () {
  $("#printButton").click(() => {
    // only the answer
    // document.body.innerText = $("#floatingTextarea").val();

    // answers & questions
    let answer1 = $("#floatingInput1").val().replace(/\n/g, "<br>");
    let answer2 = $("#floatingInput2").val().replace(/\n/g, "<br>");
    let answer3 = $("#floatingInput3").val().replace(/\n/g, "<br>");
    let answer4 = $("#floatingInput4").val().replace(/\n/g, "<br>");

    let question = $("#floatingLabel").text();

    // styling
    document.body.innerHTML = `
        ΕΡΩΤΗΣΗ:<br/>${question}<br/><br/>
        ΑΠΑΝΤΗΣΗ:<br/>
        1. ${answer1}<br/> 
        2. ${answer2}<br/> 
        3. ${answer4}<br/> 
        4. ${answer3}<br/> 
        `;
    // print
    window.print();
    // reload page
    window.location.reload();
  });

  $(window).resize();
});
