Answers for "javascript to print page"

3

how to print to screen in javascript

console.log("Hello World!");
alert("Console has been updated.");
Posted by: Guest on October-23-2020
9

how to code print in javascript

console.log("print")
//or
alert("Print")
Posted by: Guest on April-07-2020
0

print page using js

$('.print-btn').click(function(){
  var printed_id = $(this).attr('data-id');
  if( printed_id ){
    var printed_content = $($('#' + printed_id).html());
    $('body').children().css('display', 'none');
    $('body').append(printed_content);
    window.print();
    printed_content.remove();   
    $('body').children().css('display', '');    
  }
});
Posted by: Guest on July-12-2021

Browse Popular Code Answers by Language