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">
  <p>example text one.</p>
</div>
<div id="two">
  <p>example text two.</p>
</div>
</body>
</html>
 
var two = document.getElementById("one");
two.insertAdjacentHTML('afterbegin', '<div><p>after begin.</p></div>');
two.insertAdjacentHTML('beforebegin', '<div><p>before begin.</p></div>');
two.insertAdjacentHTML('beforeend', '<div><p>before end.</p></div>');
two.insertAdjacentHTML('afterend', '<div><p>after end.</p></div>');
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers