Question: ```
<!DOCTYPE html>
<html>
    <head>
        <title>Get Value form Textbox</title>
    </head>
    <body>
        <form>
            First Name:<input type="text" id="firstname" value="firstname"> Last Name:<input type="text" id="lastname" value="lastname">

```

This is the script which I believe to be causing problems, I am unsure if this is the correct method to use to get the value of the textbox

```
            <script>
                var first_name = document.getElementById("firstname");
                var last_name = document.getElementById("lastname");
            </script>

            <p></p>
            <input type="submit" value="Submit" onclick="my_checker(first_name, last_name);">
        </form>
        <script>
            function my_checker(fName, lName)
            {
                alert("Hello " + fname + " " + lname);
            }
        </script>
    </body>
</html>

```

Answer: 
I think this is what you want.

```js
function my_checker(){
      var fname = document.getElementById("firstname").value;
      var lname = document.getElementById("lastname").value;
      alert("Hello " + fname + " " + lname);
}
```

```html
    <head>
        <title>Get Value form Textbox</title>
    </head>
    <body>
        <form>
            First Name:<input type="text" id="firstname" value="firstname"> Last Name:<input type="text" id="lastname" value="lastname">
              <p></p>
            <input type="submit" value="Submit" onclick="my_checker();">
        </form>
```
This one is not the right method but still..
if you want the code has two error first variable you are receiving and trying to alert both are different (fName, lName) / (fname, lname). secondly to access value u need document.getElementById("firstname").value tag

```
<script>
            var first_name = document.getElementById("firstname").value;
            var last_name = document.getElementById("lastname").value;
        </script>

            <p></p>
            <input type="submit" value="Submit" onclick="my_checker(first_name, last_name);">
        </form>
        <script>
            function my_checker(fname, lname)
            {
                alert("Hello " + fname + " " + lname);
            }
        </script>
    </body>
</html>

```