Use Jquery code the following way in Magento 2
<script>
require([
‘jquery’
], function ($) {
$(function () {
// Write code here
});
});
</script>
<script>
require([
‘jquery’
], function ($) {
$(function () {
// Write code here
});
});
</script>