How to use jquery in node js. Please Help me I'm using this code
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const { window } = new JSDOM('<!DOCTYPE html>');
const $ = require('jquery')(window);
var connection = require('./database');
connection.query(
"SELECT * FROM cr_state",
function(error, results, fields) {
if (error) throw error;
$('#state').html('<option value="1">test</option>')
}
);
But this code is not working.How to use jquery?