1

Adding "use strict" to this function is breaking it. Specifically the inputs I am trying to un-disable are remaining disabled in strict mode. csc_popup_in() and csc_popup_out() functions are defined prior to this one. Thanks in advance for any input.

function show_cc(){
    document.getElementById('cc_fade').className='none';

    var cc_inps = document.getElementById('cc_fade').getElementsByTagName('input');
    for(i=0 ; i<cc_inps.length ; i++){
        cc_inps[i].disabled=false;
    }

    document.getElementById('csclnk').onmouseover = function(){csc_popup_in();};
    document.getElementById('csclnk').onmouseout = function(){csc_popup_out();};

    if(document.getElementById('amex').checked){
        document.getElementById('cc_num').maxLength = 15;
        document.getElementById('cc_csc').maxLength = 4;
    } else {
        document.getElementById('cc_num').maxLength = 16;
        document.getElementById('cc_csc').maxLength = 3;
    }
}
4

1 回答 1

4

你忘了用var!!!声明 "i"

于 2013-04-30T00:06:06.317 回答