Related to this question here. Can I check if an element in the DOM has a value or not? I'm trying to put it into an 'if' statement and not sure if my approach is correct. Here goes:
if (document.getElementById('customx')){
//do something
}
Or should it be:
if (document.getElementById('customx') == ""){
//do something
}
EDIT: By value I mean, customx is a text input box. How can I check if this field has no text entered.