I need to write, in JavaScript (I am using jQuery), a function that is aware of the number of characters that fit in a line of the browser window. I\'m using a monospace fo
You can get the total width available for the browser with
window.innerWidth
And then you can get the width of an element with the following method.
document.getElemenById('elem').clientWidth