Hello, im tyring to change an icon for a button based on a condition


<ext:Button ID="NotifLogo" runat="server" Text="Notification">
           <Listeners>
               <Click Handler="#{NotificationsWindow}.show(); ReloadMe(); " />
           </Listeners>
</ext:Button>

and my JS code:

<script type="text/javascript">
        if (1 != 2) {
            if (1 < 2) {
                Ext.Net.ResourceManager.RegisterIcon(["BellStop"]); //if an icon has not been registered yet
                NotifLogo.setIconClass("icon-bellstop");
               
            } else {
                Ext.Net.ResourceManager.RegisterIcon(["Bell"]); //if an icon has not been registered yet
                NotifLogo.setIconClass("icon-bell");
            }
        }

Any help would be appreciated as my JS code does not work