JavaScript: Verify if an html element is empty