SOURCE

console 命令行工具 X clear

                    
>
console
  <div class="container">
    <div class="box box1"></div>
    <div class="box"></div>
    <div class="box"></div>
  </div>
  <button onclick="addText()">添加文字</button>

  <style>
      .container{display: flex;width: 120px;}
      /* .box{flex: 0 0 40px;min-height: 1em;background: red;margin: 10px;;} */
      .box{flex: 0 0 40px;min-height: 1em;background: red;margin: 10px;max-width: 40px;}
  </style>

  <script>
      function addText() {
        let tag = document.querySelector('.container .box1')
        tag.innerText = tag.innerText + '中'
        // tag.innerText = tag.innerText + 1
    }
  </script>