title: Print a div in Chrome and Safari
body: <p><strong>jQuery</strong></p>
  
  <pre><code> $(function(){
      $("#btnPrint").click(function(){
        var mydiv = document.getElementById("printDiv");
      printDiv(mydiv);
      });
  
      });
  
      function printDiv(divP) {
  
                  window.frames["print_frame"].document.body.innerHTML = $(divP).html();
                  window.frames["print_frame"].window.focus();
                  window.frames["print_frame"].window.print();
  
              }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code> &lt;iframe name="print_frame" width="0" height="0" frameborder="0" src="about:blank"&gt;
          &lt;/iframe&gt;
  
  &lt;div id="printDiv"&gt;
  //some content here
  &lt;/div&gt;
  
  &lt;input type="button" id="btnPrint" value="Print"/&gt;
  </code></pre>
  
  <p>The above code is working in IE and Mozilla but not working in Safari,chome and Opera? Please help..</p>