Problems using jQuery and sequelize with Electron

hi, im new to Electron and struggle a bit. i have built a application which connects via Sequelize to my mysql database and should do some CRUD.
So i start index.html from the app.js file, and connect to the DB via sequelize in the Database.js file.

i wrote a simple query to test inserting to the db with the id insert:

const $ = jQuery = require('jquery');

const { remote } = require('electron');

var win = remote.getCurrentWindow();

const { getCurrentWindow, globalShortcut } = require('electron').remote;

const {Sequelize, DataTypes} = require("sequelize");

const db = new Sequelize('mysql://*******@**********);

$(window).on("load", function () {

    console.log("loaded");

    $("#minimize").click(function () {

        console.log("minimize");

        win.minimize();

    });

    $("#maximize").click(function () {

        console.log("maximize");

        if (win.isMaximized()) {

            win.unmaximize();

        } else {

            win.maximize();

        }

    });

    $("#close").click(function () {

        console.log("close");

        win.close();

    });

    $("#insert").click(function () {

        

      db  

      .authenticate()

      .then(() => {

        console.log('Connection successfully made.');

             

      })

      .catch(() => {

        console.log('Error connecting to database');

      

      });

             

              const Parts = db.define('bestandstool', {

      

                  // Model attributes are defined here

                  Hersteller: {

                    type: DataTypes.STRING,

                    allowNull: false

                  },

                  Beschreibung: {

                    type: DataTypes.STRING,

                    allowNull: false

                  },

                  Teilenummer: {

                    type: DataTypes.STRING,

                    allowNull: false

                  },

                  Preis: {

                    type: DataTypes.STRING,

                    allowNull: false

                  },

                  SKU: {

                    type: DataTypes.STRING,

                    allowNull: true

                  },

                  

                }, {

                  tableName: 'Teileliste',

                  timestamps: false

                });

                db.sync({ force: false }) 

                .then(function() {

                  var partinstance = Parts.build({

                  Hersteller: "Volkswagen",

                  Beschreibung: "Tacho, Kombiinstrument",

                  Teilenummer: "3H0959876B",

                  Preis: "19,95€",

                  SKU: "A35"

                })

                partinstance.save()

                }) 

                

                .then(() => {

                  console.log("All models were synchronized successfully.");

                }) 

                .catch(() => {

                  console.log('Error syncing models.');

                

                });

      

          });

    

});

var reload = ()=>{

    getCurrentWindow().reload()

  }

  

  globalShortcut.register('F5', reload);

  globalShortcut.register('CommandOrControl+R', reload);

  window.addEventListener('beforeunload', ()=>{

    globalShortcut.unregister('F5', reload);

    globalShortcut.unregister('CommandOrControl+R', reload);

  }) 

if i try to run this in my index.html with :

<div id="container">

      <nav>

          

          <div id="buttons">

              <div id="minimize">

                <span id="minimize-font">&mdash;</span>

              </div>

              <div id="maximize">

                <span id="size-font">&#9723;</span>

              </div>    

              <div id="close">

                 <span id="close-font" >&#10005;</span>

              </div>

              <button id="insert" style="margin-top: 120px; color: black; margin-left: 150px; position: absolute; ">TEST</button>

            </div> 

        </nav>

    </div> 

this works perfectly. But i have no chance to get this running in my “newArticle.html” which contains a input form.

Any idea what im doing wrong?