Answers for "print page javascript"

2

javascript print

document.write("Hello world");
Posted by: Guest on October-08-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