Typically in JavaScript I do something like the below to verify an element does exist:
if (document.getElementById(\'lblUpdateStatus\')) { $(\"#lblUpdateStat