Wuwu
0
Q:

javascript add adjacent html

<!-- beforebegin -->
<p>
  <!-- afterbegin -->
  foo
  <!-- beforeend -->
</p>
<!-- afterend -->
0
ul = document.querySelector('ul');

ul.insertAdjacentHTML('afterbegin','<li>Hello</li>'); 

// 	 <ul>
//		<li>Hello</li>
//    </ul>
0

New to Communities?

Join the community