Check if a string is valid HTML using JavaScript

Your environment: