In order to empty the contents of a table cell, I issue the following command:
$('td').empty()
but to empty the contents of an input field, I say:
$('input').val() -- Edit: .val('')
Q: Doesn't this go against the idea of object oriented programming? Wouldn't you have the same method for each which means "Whatever you need to do to empty yourself, you now have my permission to do so"?
Like, if you have a cat.speak and a dog.speak and the cat meows and the dog barks.