JSFiddle - React, Tailwind, and code Playground

HTML

<div class="div_frame">

        <div class="list_title">To-Do List</div>

        <div class="list_in">
            <input class="list_input" id="list_input" type="text" placeholder="輸入代辦事項。。。">
            <button class="list_btn" onclick="add_list()">add</button>
        </div>

        <div class="list_out">

            <ul class="list_ul" id="list_ul">
                <li>
                  <span id="span[0]">1.倒垃圾</span>
                  <button onclick="remove_list()">X</button>
                </li>
                <li>
                  <span id="span[1]">2.繳電話費</span>
                  <button onclick="remove_list()">X</button>
                </li>
                <li>
                  <span id="span[2]">3.採買本週食材</span>
                  <button onclick="remove_list()">X</button>
                </li>
            </ul>

        </div>

        <div class="list_remit">
          <button class="remit_btn" onclick="list_remit()">remit</button>
        </div>

    </div>

CSS

.div_frame{
    width:500px;
    /*height: 500px;*/
    border-radius:20px;
    border:0;
    background-color:#fbf470;
}

.list_title{
    width: 500px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    font-size: 20px;
    font-family: Comic Sans MS;

    /*border-style:solid;*/
}

.list_in{
    width: 500px;
    height: 50px;
    font-size: 20px;
    font-family: Comic Sans MS;

    display: flex;
    justify-content:center;
    align-items: center;

    /*border-style:solid;*/
}

.list_input{
    width: 300px;
    height: 30px;

    border-radius: 10px 0 0 10px;
    border:0;
    outline:none;
    
    font-family: Comic Sans MS , Microsoft JhengHei;
    text-indent: 10px;  /*輸入文字邊距*/
    transition: 0.1s;
}

.list_btn{
    width: 50px;
    height: 30px;
    box-sizing: content-box;

    border-radius: 0 10px 10px 0;
    border:0;
    
    font-family: Comic Sans MS;
    transition: 0.1s;
}
.list_btn:hover , .list_input:hover{
    box-shadow: 0px 0px 2px 2px #b1b1b1;
    z-index: 1;
}
.list_btn:active{
    box-shadow: inset 0px 0px 3px 3px #b1b1b1;
}

.list_out{
    width: 500px;
    /*height: 300px;*/
    font-size: 20px;

    font-family: Comic Sans MS , Microsoft JhengHei;

    display: flex;
    justify-content:center;

    /*border-style:solid;*/
}

.list_ul{
    list-style-type:none;   /*消除點*/
    padding-left: 0;        /*消除原本點的位置*/
}

.list_ul li{
    width: 350px;
    margin-top: 10px;       /*li之間分隔*/


    display: flex;
    justify-content: flex-end;

    
    border-bottom: 1px solid #000;
    background:#ffffffa3;
}

.list_ul li span{
    flex: 1;
    font-family: Comic Sans MS , Microsoft JhengHei;
}

.list_ul li button{

    color: red;
    background-color: transparent;
    border: 0;
    font-family: Comic Sans MS , Microsoft JhengHei;
    transition: 0.3s;
}
.list_ul li button:hover{
    font-weight: bold;
    transform: scale(1.5);
}
.list_ul li button:active{
    transform: scale(1.2);
}

.list_remit{
    width: 500px;
...

JavaScript

var sort = 3;       //目前清單內容數量

function add_list(){

    var add_text = document.getElementById('list_input').value;     //取輸入文字

    var list_ul = document.getElementById('list_ul');
    var creat_li = document.createElement('li');
    var creat_sapn = document.createElement('span');
    var creat_btn = document.createElement('button');

    creat_sapn.setAttribute('id', 'span['+ (sort) + ']');         //新增span id=span[]

    creat_sapn.textContent = (sort+1).toString() + '.' + add_text;
    creat_btn.textContent = "X";
    creat_btn.onclick = remove_list;
    

    list_ul.append(creat_li);
    creat_li.append(creat_sapn);
    creat_li.append(creat_btn);

    
    console.log(creat_sapn.textContent);
    console.log(list_ul);
    console.log(creat_li);
    sort++;
}

function remove_list(){


    var remove_list_num = event.target.parentElement.children[0].textContent.substring(0,1);


    for(i = remove_list_num; i < sort; i++){
        document.getElementById('span[' + i +']').textContent = i + '.' + document.getElementById('span[' + i +']').textContent.substring(2);       //更改文字
        document.getElementById('span[' + i +']').id = 'span[' + (i-1) +']';        //更改id
    }


    console.log(remove_list_num);
    console.log(document.getElementById('span[0]').textContent);


    event.target.parentElement.remove();
    sort--;
}

function list_remit(){


    var ul_array = document.getElementById('list_ul').children;     //ul內容

    //console.log(document.getElementById('list_ul').children[0]);
    //console.log(ul_array);


    var list_content = "";
    for(var x of ul_array){

        list_content = list_content + x.children[0].textContent + "\n";
        //console.log(x);
        //console.log(list_content);
        
    }
    alert(list_content);

}