locked
Print Variable in Bold using windows.print() RRS feed

  • Question

  • User-797751191 posted

    Hi

      I have below code for print , i want to print variable Name in bold. Secondly Date is getting printed i want to hide it.

    <script type="text/javascript">     
            function PrintDiv()
            {
                var divToPrint = document.getElementById('divToPrint');
                var Name = document.getElementById("txtName"); 
                Name.setAttribute("value", Name.value);
                var popupWin = window.open("");
               popupWin.document.open();
               popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
                popupWin.document.close();
            }
         </script>


    <div id = "divToPrint">
    <div class="container">
    <div class="row">
    <div class="col-md-12">
    <div class="Inner1">
    <p>The Head</p>
    <p>Subject :</p>
    </div>
    </div>
    </div>
    </div>
    </div>

    Thanks

    Friday, June 21, 2019 7:39 AM

All replies