Is there a way to detect if a tag is self closing with JQuery like an image tag? Something dynamic not just an image tag.
if ($(\'.selector\')[0].tagName.to
jQuery uses this list internally:
/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i
You can do the same:
if(/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i.test($('.selector')[0].tagName)) { //do something }