Knowledge Walls
Laya
Hyderabad, Andhra Pradesh, India
window.print() Method in Window Object of Javascript Syntax with Examples
2713 Views
Usage 
The print() method is used to print the current document.
Syntax 
window.print();
Example
	<button onclick="javascript:showwindow();">Focus window</button>
	var myWindow = window.open("http://www.knowledgewalls.com","","width=800,height=300");
	
	function showwindow(){
	  myWindow.focus();
	myWindow.print();
	}
Output 
Once we click Show window button,new window will get focused and get printed.
Best Lessons of "Javascript Syntax with Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details