JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./index.css">
    <title>Document</title>
</head>

<body>
    <div id="h1Block">
        <h1>TO-DO-LIST</h1>
    </div>
    <div id="inputBlock">
        <div class="input-area">
            <input type="text" id="input" placeholder="請輸入待辦事項...">
            <br>
            <button onclick="inputBtn()" class="inputBtn">submit</button>
            <button onclick="exportBtn()" class="exportBtn">Export</button>
        </div>
    </div>
    <hr>
    <div id="outputBlock">
        <ul id="list">

        </ul>
    </div>
    <script src="./index.js"></script>
</body>

</html>

CSS

body {
    background-color: darkslateblue;
    /* background-repeat: none; */
    background-size: cover;
}

#h1Block {
    color: whitesmoke;
    font-size: larger;
    font-family: Fantasy;
    font-weight: bolder;
    /* font-style: italic; */
    text-decoration: underline;
    text-align: center;
}

#inputBlock {
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
}

#input {
    width: 75%;
    height: 24px;
    font-size: 24px;
    border-radius: 10px;
}

.inputBtn {
    border: 0px;
    font-size: 24px;
    color: black;
    border: 3px solid darkred;
    border-radius: 8px;
    margin: 20px;
}

.inputBtn:hover {
    cursor: pointer;
    background-color: darkred;
    color: white;
}

.exportBtn {
    border: 0px;
    font-size: 24px;
    color: black;
    border: 3px solid darkgreen;
    border-radius: 8px;
    margin: 20px;
}

.exportBtn:hover {
    cursor: pointer;
    background-color: darkgreen;
    color: white;
}

#outputBlock {
    font-size: 18px;
    color: white;
    display: block;
    width: 80%;
    margin-left: 7%;
    margin-right: 10%;
    align-items: center;
}

#list {
    list-style-type: none;
}

#list li {
    padding: 5px;
    border-bottom: 1px dashed whitesmoke;
    display: flex;
}

#list span {
    width: 90%;
}

#list button {
    border-radius: 5px;
    border: 0 px;
    width: 10%;
    border: 3px solid black;
}

#list button:hover {
    cursor: pointer;
    background-color: rgb(36, 35, 35);
    color: white;
}

JavaScript

function inputBtn() {
    const listText = document.getElementById("input").value;
    var list = document.getElementById("list");
    var elemSpan = document.createElement('span');
    var elemLi = document.createElement('li');
    var elemBtn = document.createElement('button')

    elemSpan.textContent = listText;
    elemBtn.textContent = "Del";
    list.append(elemLi);
    elemLi.append(elemSpan);
    elemLi.append(elemBtn);

    elemBtn.onclick = delBtn;
}

function delBtn() {
    event.target.parentElement.remove();
}

function exportBtn() {
    let listText = document.getElementById('list').children;
    let exportText = "待辦事項: ";
    let num = 1;

    for (var x of listText) {
        exportText = exportText + '(' + num.toString() + ')' + x.children[0].textContent + " ";
        num = num + 1;
    }
    alert(exportText);
}