Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
    <p class="premier">Para 1</p>
    <p><em>second </em> Para 2</p>
    <p id="dernier"> dernier Para</p>
    <!-- je suis un commentaire -->
</body>
</html>
 
//document.body.lastChild.previousElementSibling.classList.add("red");
//document.body.lastElementChild.classList.add("red");
//document.querySelectorAll("#dernier")[0].classList.add("red");
//document.body.getElementById("#dernier").classList.add("red");
//console.log(document.body.lastElementChild.nodeName)
console.log(document.body.lastElementChild.nodeName); //Script
Output

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

Dismiss x
public
Bin info
dupontpro
0viewers