Skip to content

Instantly share code, notes, and snippets.

@backslash112
Created July 10, 2018 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save backslash112/09239f7d5f8ab8fe4fc46993e256116a to your computer and use it in GitHub Desktop.
Save backslash112/09239f7d5f8ab8fe4fc46993e256116a to your computer and use it in GitHub Desktop.
Pring Leetcode question
document.getElementsByTagName('body')[0].innerHTML = document.querySelectorAll('.question-description__3U1T')[0].innerHTML;
var css = 'body {line-height:1.2} p { font-size: 11px; margin:0px; padding:0px } pre {font-size:8px; margin:0px; padding:2px 4px} code {font-size:8px}',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
// This is required for IE8 and below.
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
window.print()
@backslash112
Copy link
Author

how many questions:
document.getElementsByTagName('tr').length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment