Document*{padding: 0;margin: 0;}.box{width: 211px;height: 101px;margin: 200px auto;border: 2px solid #939090;display: flex;}input{height: 100px;outline: none;border: none;text-align: center;}button{width: 50px;height: 50px;outline: none;font-size: 30px;}.bottom{display: flex;flex-direction: column;border: 1px solid #939090;}//先获取元素const input=document.querySelector('input')const btn=document.querySelectorAll('button')//给加号添加事件 btn[0].addEventListener('click',function() { input.value++ btn[1].disabled=false })//给减号添加事件 btn[1].addEventListener('click',function() {input.value--if(input.value<=1){btn[1].disabled=true} })