Popover Test

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

Thumbnail
This awesome code was written by hugofovargue, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright hugofovargue ©
  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Popover Test</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div>  
  <input id="input-name" type="text" onclick="popover()" />
  <div class="popover" id="popover-name">
    <span class="payload">Hey this is useful info.</span>
    <span class="timer"></span>
  </div>
  <input id="input-name" type="text" onclick="popover()" />
  <div class="popover" id="popover-text">
    <span class="payload">Not important.</span>
    <span class="timer"></span>
  </div>
<div>
  
  

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




</body>

</html>

/*Downloaded from https://www.codeseek.co/hugofovargue/popover-test-mwopPZ */
.popover {
  position: absolute;
  padding: 5px;
  background-color: lightblue;
  visibility: hidden;
}

#popover-text {
  top: 50px;
  left: 100px;
  background-color: lightred;
}

/*Downloaded from https://www.codeseek.co/hugofovargue/popover-test-mwopPZ */
function popover(){
  var input = document.getElementById('input-name');
  var p = input.nextElementSibling;
  p.style.visibility = 'visible';
  conosle.log(p);
}

Comments