So, how is that possible?
Let me create a HTML Structure to put the content in a formatted manner.
I made use of extra tags in order to center the content and also the CSS does the same. The span tags inside console are used to display the content. I used JQuery just for my convenience. It is completely avoidable. But then, JQuery reduces code considerably. The main.css give the styling to the page.
Finally, main2.js does the actual computation.
Once I identify the browser and the OS, I directly add it to the html of the span tags which I referred using the id attribute in html.
And this is what you see on the screen.
Ping me for any doubts.