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

    // answer & question
    let answer1 = $("#floatingTextarea1").val().replace(/\n/g, "<br>");

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

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

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