use hasAttribute("foo") instead of dataset.foo != null (fix #5)