From what I can understand, you want the text that is typed in the text1 and text2 input fields. You can do so with the .val()
function, like this:
$("#print").click(function(){
alert($('#l').val() + '\n' + $('#m').val());
window.print();
});
solved Printing an HTML form using jQuery