So I have a problem, im looking to pass very basic user input into a javascript function for javascript to then process that information, I am really only looking to pass strings, however I just want to learn the concept. Below is how I would (THINK) you'd do this, but it doesn't work and I am not sure why. Could someone show me how to do this simply and properly.
<body>
<form id="frm1">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br><br>
<input type="button" onclick="myFunction(fname, lname)" value="Submit">
</form>
<script>
function myFunction(fname, lname) {
console.log(fname);
console.log(lname);
}
</script>
</body>
myFunction(this.form.fname.value, this.form.lname.value)thiscome from?