Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

printDiv

Posted on February 21, 2013October 26, 2015 By David Kittell
function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;
     document.body.innerHTML = printContents;
     window.print();
     document.body.innerHTML = originalContents;
}
<input type='button' value='Print This Only' onclick='printDiv(example);'/>
Originally Posted on February 21, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code JavaScript

Post navigation

Previous post
Next post

Related Posts

PowerShell – Add Windows Feature IIS Site Management

Posted on March 14, 2016March 14, 2016

If you are on a freshly installed Windows server and can’t find IIS Site Mangement try this script below. get-windowsfeature|where{$_.name -eq "BITS-IIS-Ext"}|add-windowsfeature get-windowsfeature|where{$_.name -eq "Web-Scripting-Tools"}|add-windowsfeature All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system…

Read More

UNIX Bash – Create Date/Time File Name

Posted on August 25, 2016October 4, 2019

When you need to create a log file or some dated archive echo "This is a dated file $(date +%Y_%m_%d_%H.%M.%S)" > testfile_`date +%Y_%m_%d_%H.%M.%S`.txt The format can be modified slightly based on date formatting. Originally Posted on August 25, 2016Last Updated on October 4, 2019 All information on this site is…

Read More

Mac OSX Terminal – Change/Set DNS

Posted on May 27, 2016June 4, 2020

This may need to change depending on your network interface Manual Process # Only friendly names networksetup -listallnetworkservices # Useful information networksetup -listallhardwareports Running the above will display something like this An asterisk (*) denotes that a network service is disabled. Ethernet FireWire Wi-Fi Bluetooth PAN Thunderbolt Bridge # Optional…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes