Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div class="boxsizing">
  <h1>200px</h1>
  <p> box-sizing: border-box</p>
 
</div>
</body>
</html>
 
p {
   background : red;
    width : 200px;
    height: 100px;
    border : 5px solid black
}
.box {
   box-sizing: border-box;
}
div {
  width:200px;
  border:1px solid;
}
 
(function(){
  var testborder = function(){
    var p = document.querySelector(".boxsizing > p").classList.toggle("box");
   
};
  
document.querySelector(".boxsizing").addEventListener("click",testborder);
}());
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
dupontpro
0viewers