jquery nodename returning undefined September 15, 2023 by Tarik Use the prop() of jQuery: alert($('#last').prop("nodeName"));