Question: New to javascript and just trying to make a simple form validation where if the user/pass is valid the box border turns green, and if invalid, it turns red (pictured) [Valid/Invalid](https://i.stack.imgur.com/Qlmd0.png) 

Here is my HTML: (Form Works, I'm guessing I'm screwing up on the listeners and Handlers)

```
<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php">
  <input type="text" name="username" value="Username" minLength="6" maxlength="10" required>
  <br><br>
  <input type="text" name="password" value="Password" minLength="8" maxlength="15" required>
  <br><br>
  <input type="submit" value="Submit" onclick="function(changeStyle)">
</form> 

<script src="Script1.js">
</script>

</body>
</html>

```

Javascript:

```
function valid() {
  var textElements = document.getElementsByTagName('input');
    textElements[i].addEventListener('input', function(changeStyle) {
    if (event.target.validity.valid) {
        textElements[i].style.border = "solid green 2px";
        textElements[i].style.boxShadow = "0 0 5px green";
    } else {
        textElements[i].style.border = "solid red 2px";
        textElements[i].style.boxShadow = "0 0 5px red";
    }
}, false);

}

</script>

```

Answer: 
```
"code": 403,
  "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
 }
}

```

This means that you have exceeded your limit to serve videos from youtube.
You need to create an account to be able to show more videos.

If you're sure you haven't exceeded your limit/ have an account double check your developer console that the API is turned on.
[Developer Console](https://console.developers.google.com/apis).

What I would suggest is to add a `catch` to your call to handle errors in the future.

```
axios
  .get("https://www.googleapis.com/youtube/v3/search", {
    params: {
      keys: API_KEY,
      type: "video",
      part: "snippet",
      q: searchTerm
    }
  })
  .then(response => console.log(response));
  .catch(err => { console.log(err); }

```
Put your Api key in url like 

"<https://www.googleapis.com/youtube/v3/search?key=YOUR_API_KEY>"

```
axios.get("https://www.googleapis.com/youtube/v3/search?key=Your_Api_Key", {
          params: {
            type: "video",
            part: "snippet",
            q: searchTerm
          }
        })
        .then(response => console.log(response));

```

You will find an example as well [here](https://developers.google.com/youtube/v3/getting-started)