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>부트스트랩</title>
</head>
<body>
  <div>
    <ul>
      <li id="list1">1. 웹 프로그래밍 기초</li>
      <li id="list2">2. DB연결 웹 애플리케이션</li>
      <li id="list3">3. 웹 애플리케이션 개발 1/4</li>
    </ul>
  </div>
  <button id="replaceTextNodeButton">textNode 변경</button>
</body>
</html>
 
var replaceTextNodeButton = document.getElementById("replaceTextNodeButton");
replaceTextNodeButton.addEventListener("click", function(){
  var ul = document.querySelector("ul");
  var firstLi = ul.firstElementChild;
  
  var textNode = document.createTextNode("텍스트 노드 변경");
   firstLi.replaceChild(textNode, firstLi.firstChild);
});
Output

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

Dismiss x
public
Bin info
moonki-chopro
0viewers