Calling jQuery method from onClick attribute in HTML

前端 未结 5 1284
半阙折子戏
半阙折子戏 2020-12-14 16:45

I am relatively new to implementing JQuery throughout an entire system, and I am enjoying the opportunity.

I have come across one issue I would love to find the corr

5条回答
  •  生来不讨喜
    2020-12-14 17:05

    this works....

    
    

    .

       
          
    Welcome!

    edit

    you are using a failsafe jQuery code using the $ alias... it should be written like:

    (function($) {
      // plugin code here, use $ as much as you like
    })(jQuery); 
    

    or

    jQuery(function($) {
       // your code using $ alias here
     });
    

    note that it has a 'jQuery' word in each of it....

提交回复
热议问题