Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <ul id="myList">
  <li>첫 번째 아이템</li>
  <li>두 번째 아이템</li>
  <li>세 번째 아이템</li>

<button id="removeItemBtn">마지막 아이템 삭제</button>




                const removeButton = document.getElementById("removeItemBtn");
removeButton.addEventListener("click", removeLastListItem);

function removeLastListItem() {
  const myList = document.getElementById("myList");
  const listItems = myList.getElementsByTagName("li");

  // ul에 li 아이템이 있는 경우에만 실행
  if (listItems.length > 0) {
    // 마지막 li 아이템을 제거
    myList.removeChild(listItems[listItems.length - 1]);

// 버튼 클릭 이벤트를 추가합니다.