Why not just call the print() function from within an other function?
Like:
function myPrint() {
$("#myDiv").css({"border-color":"red"});
window.print();
}
Then you could call it from where you need it.
More Related Contents:
- How to send data to the server via Ajax?
- jQuery append function is just appending the html but not the classes related to it
- Updating php values using jquery
- Displaying selected dropdown option [closed]
- HTML: how refresh information in [closed]
- How could I make a calendar? [closed]
- Download the text over image using jquery
- HTML Form Submit pass array to PHP [closed]
- Dynamic page load can’t load Java with page
- Load More Posts Ajax Button in WordPress
- “Mixed content blocked” when running an HTTP AJAX operation in an HTTPS page
- How to refresh page on back button click?
- Displaying pdf from arraybuffer
- Webhoster inserts a javascript which brokes my code how to remove it?
- How to hide form code from view code/inspect element browser?
- How to prevent page from reloading after form submit – JQuery
- pdf file upload ajax html
- how to assign javascript variable value to php variable
- Populating a select box using JQUERY, AJAX and PHP
- html download attribute redirects to url instead of downloading
- Get the content (text) of an URL after Javascript has run with PHP
- Passing JSON data from php to html-data attribute and then to Javascript
- IE10/11 Ajax XHR error – SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3
- Print a div content using Jquery
- Send form data using ajax
- Stripe Payment: Getting Error as Customer cus_***** does not have a linked card with ID tok_*****
- How to send secure AJAX requests with PHP and jQuery
- How to submit checkboxes from all pages with jQuery DataTables
- XMLHttpRequest; Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource [duplicate]
- How to replace the entire html webpage with ajax response?