hide html view logic works, js needs help