Horje
print a specific div in javascript Code Example
print a specific div in javascript
function PrintElem(elem) {
    const mywindow = window.open('', 'PRINT', 'height=400,width=600');

    mywindow.document.write('<html><head><title>' + document.title  + '</title>');
    mywindow.document.write('</head><body >');
    mywindow.document.write('<h1>' + document.title  + '</h1>');
    mywindow.document.write(document.getElementById(elem).innerHTML);
    mywindow.document.write('</body></html>');
    mywindow.document.close(); // necessary for IE >= 10
    mywindow.focus(); // necessary for IE >= 10*/
    mywindow.print();
    mywindow.close();
    return true;
}




Javascript

Related
document.append Code Example document.append Code Example
kendo dropdownlist value jquery Code Example kendo dropdownlist value jquery Code Example
snap to grid Code Example snap to grid Code Example
react chartjs size Code Example react chartjs size Code Example
pass url params to child router express Code Example pass url params to child router express Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8