Modified to correctly handle xhtml pages

This was required because jQuery.prop('tagName') returns upper-case on
html5 pages and returns lower-case on xmhtl pages
fix