Does anyone know what the best method would be to work out how many characters can fit inside a DIV block in HTML using JavaScript?
Any advise would greatly help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could iteratively add your characters to a hidden div and check the width of that. Not sure if there is a better way.
Edit: Something like this: