Check for change in class?

I have an Intranet page that I’m trying to interact with, and I need to know if an icon is greyed-out or not. When I inspect the element, here’s what I see:

with the icon not greyed-out:

<a class="x-btn g-no-menu-icon x-unselectable x-box-item x-toolbar-item x-btn-plain-toolbar-small" hidefocus="on" unselectable="on" id="TabBar:UnsavedWorkTabBarLink" tabindex="0" data-qtip="Unsaved Work" componentid="TabBar:UnsavedWorkTabBarLink" style="right: auto; left: 0px; top: 3px; margin: 0px;">

with the icon greyed-out:

<a class="x-btn g-no-menu-icon x-unselectable x-box-item x-toolbar-item x-btn-plain-toolbar-small x-item-disabled x-btn-disabled" hidefocus="on" unselectable="on" id="TabBar:UnsavedWorkTabBarLink" data-qtip="Unsaved Work" tabindex="-1" componentid="TabBar:UnsavedWorkTabBarLink" style="right: auto; left: 0px; top: 3px; margin: 0px;">

The difference being that the greyed-out version has the additional ccs classes x-item-disabled and x-btn-disabled, as as tabindex is -1 instead of 0. Otherwise identical ID, so I’m not sure how to distinguish using xpath.

Note. I can’t use sourceSearch for this. I don’t know if it is just our Intranet or not, but souceSearch always pulls up stale code from when the page first loaded or was refreshed. Typically, I’ve been refreshing the page prior to a sourceSearch, but in this case I can’t because a refresh triggers a “are you sure” pop-up that I must avoid. What can I do here to check the status? Is there a way to check for class includes x-btn-disabled, for example?

Thanks.

I was able to achieve what I wanted using executeScript (not sandbox) and this command:

var element = document.getElementById('TabBar:UnsavedWorkTabBarLink');
var classes = element.className;
return classes;

and then simply checking whether or not x-btn-disabled was present.