- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020
09:45 PM
07-02-2020
09:45 PM
Add Custom JS to my custom module frontend
I have created my custom module in that a particular .phtml file i want to apply my custom JS
please suggest as soon as possible.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020
09:49 PM
07-02-2020
09:49 PM
Re: Add Custom JS to my custom module frontend
Hi @asd_asd46
If you want to add js with phtml file then you can consider below code and add with phtml file:
<script> require(['jquery', 'myscript'], function($, myscript) { cosole.log("testing"); }); </script>
Or you can refer below link :
https://magento.stackexchange.com/questions/301627/magento-2-how-to-include-custom-js-file-in-phtml-...
If issue resolve, please click on 'Kudos' & Accept as Solution!
Problem solved? Click Accept as Solution!