简体   繁体   中英

how to pass a html <select> box value into another js file in electron

I would like to get the value from a user selection option in html to a js file.

How can I go about doing this in electron. I am stuck? How can I make a variable that can go from html form to a js file?

After taking a look at the docs it looks like you can use libraries like jQuery or AngularJS with some small tweaking.

<head>
<script>
  window.nodeRequire = require;
  delete window.require;
  delete window.exports;
  delete window.module;
</script>
<script type="text/javascript" src="jquery.js"></script>
</head>

if this isn't what you are looking for you should be able to use native javascript to get the value from the select box.

document.getElementById("idOfSelectBox").value;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM