JavaScript error in Internet Explorer 11

I have one form page that submits data to the database from a popup. I added one disabled js button to send data once.It does not work on ie11, but works fine for other browsers.

  <script language="javascript" type="text/javascript">
    // disables the button specified and sets its style to a disabled "look".
    function disableButtonOnClick(oButton, sButtonText, sCssClass)
    {
        // set button to disabled so you can't click on it.
        oButton.disabled = true; 
        // change the text of the button.
        oButton.value = sButtonText; 
        // IE uses className for the css property.
        oButton.setAttribute('className', sCssClass); 
        // Firefox, Safari use class for the css property. 
        oButton.setAttribute('class', sCssClass);
    }
</script>
+4
source share
1 answer

try under code

if((navigator.userAgent.indexOf("MSIE") != -1 )
oButton.setAttribute('className', sCssClass); 
else
oButton.setAttribute('class', sCssClass);
0
source

All Articles