Check if a string is an html font in JavaScript

Viewed 143

I am making a robotic "talk and respond" console, and I want to be able to change the font in the console. I know how to change the font, but I do not want to change the font if the given font is not an actual HTML font.

Example: The user enters Arial, the command goes through. The user enters I lost my mommy, the command does not go through and the computer alerts the user that the command is invalid.

I obviously do not want to create a very large array containing all of the HTML fonts. That would not make sense.

If a jQuery solution works, then let me know. I am using jQuery in my code.

1 Answers
Related