#basic button id doesn't work with querySelector

5 messages · Page 1 of 1 (latest)

pliant cave
#

Here button should work at least 3 different way. But none of them working.

<button class="btn btn-primary" id="sendBtn">Send</button>
<script>
const electron = require("electron")
const {ipcRenderer} = electron

let sendBtn = document.querySelector("#sendBtn");
sendBtn.addEventListener('click',()=>{
  console.log("Ey")
  alert()
  ipcRenderer.send("key","Gangway chuchu boom")
})

</script>

opal brook
#

not really a TS question

#

so this might not the best place to ask those kinds of things

#

I'd recommend you to ask on Electron's Discord server if there is one

opal brook
#

!resolved