The traditional and rather ugly way of doing this is to consult a list of element names for block-level elements:
var blockRegex = /^(address|blockquote|body|center|dir|div|dl|fieldset|form|h[1-6]|hr|isindex|menu|noframes|noscript|ol|p|pre|table|ul|dd|dt|frameset|li|tbody|td|tfoot|th|thead|tr|html)$/i;
function isBlockLevel(el) {
return blockRegex.test(el.nodeName);
}