In order to implement custom jQuery functionalities, you need to include jQuery code inside require function like below code:
require(['jquery', 'jquery/ui'], function($){
jQuery(document).ready(function(){
jQuery("#mybtn").click(function(){
alert("This is syntax for jquery in magento 2");
});
//Your Custom Code
});
});
No comments:
Post a Comment