JavaScript disabled property problem with FireFox

I am writing a simple javascript code that expriments how to enable, disable html elements using JavaScript code.
I am getting the code to work on IE but FireFox seems to ignore the code without error.
In FireFox I am getting the 'called' message box but the button is not being enabled/disabled as IE does when the second button is clicked.
See attached code.

Thanns
<head runat="server">
    <title></title>
    
    <script type ="text/javascript">
      function EnableButton(id) {
 
        alert('called');
        var obutton = document.getElementById(id);
        if (obutton.isDisabled == true) obutton.disabled = false;
        else obutton.disabled = true;
          
 
        return false;
      }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:Button ID="Button1" runat="server" Text="Button"   Enabled ="false" />
        
        <asp:Button ID="Button2" runat="server"
          Text="Button" OnClientClick ="return EnableButton('Button1');"/>
    </div>
    </form>
</body>

Open in new window

Kan64Asked:
Who is Participating?
 
hieloConnect With a Mentor Commented:
try:
<script type ="text/javascript">
      function EnableButton(id) {
 
        alert('called');
        var obutton = document.getElementById(id);
        obutton.disabled = ( obutton.disabled ? false: true);
        return false;
      }
    </script>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.