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: 
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)
for some users, this error might be because of cause sanctions. so try to run your project using a DNS or VPN.