A Pen by Felipe Vieira

Thumbnail
This awesome code was written by felvieira, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright felvieira ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  Felipe Vieira</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div>
	<button>teste</button>
</div>
  
  

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




</body>

</html>

/*Downloaded from https://www.codeseek.co/felvieira/a-pen-by-felipe-vieira-wmGrwv */
div{
	background:red;
}

/*Downloaded from https://www.codeseek.co/felvieira/a-pen-by-felipe-vieira-wmGrwv */
let divs = document.getElementsByTagName("div")[0];
let but = document.getElementsByTagName("button")[0];

function alertA() {
  alert("alert A")
}

function alertB() {
 alert("alert B")
}

 divs.addEventListener("click", alertA);
 but.addEventListener("click", alertB);

Comments