I need to test if a data-* attribute exists on an element and if that attribute is filled with some value:
<input type="text" id="teste" data-validationMessage="Esse campo é obrigatório" /> <!-- Deve retornar true -->
<input type="text" id="teste" data-validationMessage="" /> <!-- Deve retornar false -->
<input type="text" id="teste" /> <!-- Deve retornar false -->
What is the safest way to do this validation with JavaScript?