Being a beginner i've tried different ways to include jquery functions in my node file. I've installed jquery and jsdom and added,
const { JSDOM } = require( "jsdom" );
const { window } = new JSDOM( "" );
const $ = require( "jquery" )( window );
to my app.js file.
My file Structure is as follows,
ProjectName
├───views
│ file1.ejs
| file2.ejs
| ...
| file6.ejs
├───public
│ ├───css
│ │ file1.css
| | ...
│ └───img
| ...
├───app.js
Now when i run any jsquery commands, for eg. $("div).text(); nothing happens. I believe this is because jquery has not been added properly. I've tried adding script tags to html but that doesnt seem to change anything, so if anyone could help me to understand what im missing or if im missing anything what i should add, for eg. if im missing a script tag. Where should i add it and how?