Perhaps `if (html.indexOf(elementId) >= 0) {` might read more nicely as there is no negation and I believe `indexOf` is just guaranteed to be less than zero if not found, not specifically -1?