I want to change the font of code block, and for this purpose I'm using Tampermonkey that loads javascript ( written by you ) every time a website loads.
Now, I'm changing the font through the following way:
var code = document.getElementsByTagName("code"); // through developer tools, I came to know that the code we see on the screen in enclosed in code tag.
code[0].style.fontFamily = "Menlo"; // the default font is `Consolas`
It works fine when I view questions on stackoverflow.com, but when I try to edit a question, it doesn't give me preview as in the following picture:
So how can I come up with a solution?