-
-
Save subramanian-vv/8466ad58c664e5fc0b736b8af9ff1bb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Weather App</title> | |
</head> | |
<body style="background-color: bisque; font-size: large;"> | |
<form class="input"> | |
<div class="form"> | |
<label for="name">Enter city name: </label> | |
<input type="text" id="city" required /> | |
</div> | |
<br> | |
<button type="submit"> | |
Get Weather | |
</button> | |
</form> | |
</body> | |
<script> | |
const {ipcRenderer} = require("electron"); | |
const form = document.querySelector("form"); | |
//Handles form submission | |
form.addEventListener("submit", (e) => { | |
e.preventDefault(); | |
const city = document.querySelector("#city").value; | |
ipcRenderer.send("city:find", city); | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment