Fixes #8721 - Replaced jQuery.attr('id') with .id