JS7

In this example below you will see how to do a JS7 with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by Dimitrios, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Dimitrios ©
  • HTML
  • CSS
  • JavaScript
    <!-- <div onclick="activeEvent()"></div> -->

<!-- <body onload="activeEvent()"> -->
<!-- <div></div> -->
<!--   </body> -->

<!-- <body>
<div onclick="activeEvent(event)">
</div>
  </body> -->
<div onclick="activeEvent(event)"> </div>

/*Downloaded from https://www.codeseek.co/Dimitrios/js7-WjJVQy */
    div {
  width: 100px;
  height: 100px;
  background:lime;
  margin:auto;
}


/*Downloaded from https://www.codeseek.co/Dimitrios/js7-WjJVQy */
    // let div = document.querySelector (`div`);
// div.style.fontSize =`20rem`;
// div.style.color=`red`;
// let p = document.createElement(`p`);
// let h1 = document.createElement(`h1`)
// p.innerHTML = `<b>some text</b>`;
// div.appendChild(p);
// div.insertBefore(h1, p);
// console.log(div.classList);

// function activeEvent(e) {
//   console.log(e.clientX);
// }

 function activeEvent(e) {
    console.log(`Event is done`);
 }

let div = document.querySelector(`div`);

div.onclick = activeEvent;

Comments