Display the values in the console log when Submit button is clicked
13:13 07 May 2022

I can't seem to make this work. Beginer here. I want to display in the console the values of first and last name. html

  `
First name:
Last name:
``

Js

`function getFormValue() {
  const firstName = document.getElementsByName("fname").value;
  const lastName = document.getElementsByName("lname").value;
  console.log(firstName + lastName);
}`

Nothing apears in the Console. Thank you

javascript