JS version of htmlentities