jQuery and other libraries, and the usage of '$'

前端 未结 6 728
孤独总比滥情好
孤独总比滥情好 2021-01-07 03:37

I have a quick, beginners-type-question. If I were to use jQuery and some other framework, would the following statement be problematic:

jQuery(document).rea         


        
6条回答
  •  清酒与你
    2021-01-07 03:57

    What you've shown is correct except that you will want to replace all instances of '$'. You will then be overriding the '$' function.

    jQuery(document).ready(function () {
        jQuery("input[name='password']").focus(function () {
            jQuery("input[value='login']").attr("checked", "checked");
        });
    });
    

提交回复
热议问题