Before reading this section, we suggest you reading Getting Started and Fundamentals to grasp the basics of Onsen UI. Don’t worry, it won’t take more than 5 minutes.
Using jQuery with Onsen UI is pretty simple.
Onsen UI components can be used as other native DOM element.
The following code illustrates how to use jQuery with Onsen UI, both loaded from the CDN.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.css">
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsen-css-components.min.css">
<script src="https://unpkg.com/onsenui/js/onsenui.min.js"></script>
<script src="https://unpkg.com/jquery/dist/jquery.min.js"></script>
</head>
<body>
<script>
$(function(){
// Initialization code
$('ons-button').on('click', function(e) {
ons.notification.alert('Button is tapped!');
})
});
</script>
<ons-button>Click me!</ons-button>
</body>
</html>