1

Possible Duplicate:
Print <div id=printarea></div> only?

Hi all,

We all know window.print().

Let us assume we have a div with some content in it. How can we print it?

Community
  • 1
  • 1
Rami Dabain
  • 4,709
  • 12
  • 62
  • 106

1 Answers1

1

Have a look at jQuery Print Element v1.2. This would obviously require the inclusion of the jQuery JS file in your project. As MattP pointed out, it can be done without jQuery and an extra plugin, but I always lean toward jQuery for cross-browser compatibility.

HTML

<div id="printDiv">Content to be printed</div>

JS/jQuery

$('#printDiv').printElement();
Dutchie432
  • 28,798
  • 20
  • 92
  • 109