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 id="one">
    <h1 class="b">Jump over the bridge</h1>
    <h1 class="c">Jump over the Bridge, again</h1>
  </div>
  
</body>
</html>
 
var hw = document.getElementById("one"),
    lp = hw.getElementsByTagName("h1");
if(lp.length) {
  console.log("there are "+lp.length+" h1 tags");
} else {
    console.log("there are no h1 tags");
}
Output 300px

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

Dismiss x
public
Bin info
FDVSpro
0viewers