title: Electron js button click not working
body: <p>I'm working on an Electron-based application, and I don't have much experience with it or JavaScript or Node.js. Currently, I just want to open a window dialoge by a click on a button. But when i click the button nothing happens.</p>
  
  <p>This is my package.json:</p>
  
  <pre><code>{
    "name": "Routingtable_Splitter",
    "version": "1.0.0",
    "description": "...",
    "main": "main.js",
    "scripts": {
      "start": "electron .",
      "pack": "build --dir",
      "dist": "build",
      "package-win": "electron-packager . Splitter --overwrite --asar=true --platform=win32 --arch=ia32"
    },
    "build": {
      "win": {
        "target": "squirrel",
        "icon": "build/icon.ico"
      }
    },
    "author": "Robert Malleschitz",
    "license": "ISC",
    "devDependencies": {
      "dialog": "^0.3.1",
      "document": "^0.4.7",
      "electron": "^2.0.4",
      "electron-builder": "^20.19.1",
      "electron-packager": "^12.1.0",
      "electron-winstaller": "^2.6.4",
      "fs": "0.0.1-security",
      "remote": "^0.2.6"
    },
    "dependencies": {}
  }
  </code></pre>
  
  <p>this is my HTML code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
    &lt;html&gt;
      &lt;head&gt;
        &lt;meta charset="UTF-8"&gt;
        &lt;title&gt;Tool&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
        &lt;h1&gt;Routingtable Splitter&lt;/h1&gt;
        &lt;main&gt;
          &lt;div&gt;
            &lt;div style="text-align:right;"&gt;
              &lt;input type="text" placeholder="Bitte Routingtabelle laden" style="width: 260px" id="actual-file"/&gt;
              &lt;input type="submit" value="Routingtabelle laden" id="load-file"/&gt;
              &lt;br&gt;&lt;br&gt;
              &lt;textarea id="editor" style="width: 400px; height: 300px;"&gt;&lt;/textarea&gt;&lt;br /&gt;
              &lt;input type="button" id="splitTable" value="Split" /&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/main&gt;
      &lt;/body&gt;
      &lt;script src="renderer.js"&gt;&lt;/script&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>this is my main.js:</p>
  
  <pre><code>const {app, BrowserWindow} = require('electron')
  const {Menu} = require('electron')
  const {dialog} = require('electron')
  const {remote} = require('electron')
  const {document} = require('electron')
  const {ipcMain} = require('electron')
  var path = require('path')
  
  var electronInstaller = require('electron-winstaller')
  
  let win = null;
  
  function createWindow () {
      win = new BrowserWindow({
      width: 1200,
      height: 1000,
      })
  
      win.loadFile('index.html')
  }
  
  const menuTemplate = [
  {
      label: 'Datei',
      submenu: [
        {
            label: 'Lade', click: () =&gt; {getRoutingTable();}
        },
        {
            label: 'Beenden', click: () =&gt; {app.quit();}
        }
      ]
    }
  ];
  
  function getRoutingTable(){
      dialog.showOpenDialog(
      {
          defaultPath: 'c./',
          filters: [
          { name: 'Text Files', extensions: ['txt'] }
      ],
          properties:['openFile']
    })
  }
  
  const menu = Menu.buildFromTemplate(menuTemplate);
  Menu.setApplicationMenu(menu);
  
  app.on('ready', createWindow)
  {
      console.log('app')
  }
  
  ipcMain.on('ldFileBtn', function (event, arg) {
      console.log('ipcMain');
      getRoutingTable();
      event.sender.send("btnclick-task-finished", "yes");
  });
  </code></pre>
  
  <p>This is my renderer.js:</p>
  
  <pre><code>const ipcRen = require('electron').ipcRenderer;
  const ldFileBtn = document.getElementById('load-file');
  ldFileBtn.addEventlistener('click', function() {
      console.log('btn_click')
      var arg = 'secondparam';
      ipcRen.send('ldFileBtn', arg);
  });
  </code></pre>
  
  <p>Why won't the button work? I hope someone can help me. Thanks in advance.</p>