Javascript Print

JavaScript help's the functionality using the print function of window object. In JavaScript print function window.print() print the current web page when it executed.

We can call function directly using onclick event.

Example

<!DOCTYPE html>  
<html>  
<body>  
<form>  
<input type="button" value="Print" onclick="window.print()" />  
</form>  
</body>  
<html>