SoFunction
Updated on 2025-03-01

Simple implementation code for js popup window

This article has shared the specific code displayed in the js pop-up window for your reference. The specific content is as follows

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <style>
    body{
      /*margin: 0;*/
    }
    #div1{
      width: 100px;
      height: 100px;
      border: 1px solid red;
    }
  </style>
</head>
<body>
<div  onmouseover="getInfo(this)" onmouseout="=''">

</div>
<button onclick="getInfo()">Getdivinformation</button>

<hr/>
<a href="" rel="external nofollow" target="_blank">I'm a hyperlink</a>
<br/><br/>
<button onclick="myopen1()">New window111111111</button>
<button onclick="myopen2()">New window222222222</button>
<button onclick="myopen3()">New window333333333</button>

<hr/>
<button onclick="myclose()">Close the sub-window</button>

<script>
  var mywin;
  function myclose(){
    if(mywin)
      ();
  }
  function myopen3(){
    mywin = ('', 'news', 'resizable=no');
  }
  function myopen2(){
    mywin = ('', 'news', 'resizable=no');
  }
  function myopen1(){
    mywin = ('', 'news', 'resizable=no');
  }
  function getInfo(obj){
//    var div1 = ('div1');

     = +',,'+;
     += '<br>'++',,'+;
    // offsetXXX can only be read, but not assigned, modify     = +100;
    // The following attributes are no longer available//     += '<br>'++',,'+;
  }
</script>
</body>
</html>

The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.