jq点击获取验证码倒计时

<div class="input">
<input type="text" name="" id="" />
<button class="getCode">获取验证码</button>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
$('.getCode').click(function() {
let count = 60;
const countDown = setInterval(() => {
if (count === 0) {
$('.getCode').text('重新发送').removeAttr('disabled');
$('.getCode').css({
background: '#497bdb',
color: '#fff',
});
clearInterval(countDown);
} else {
$('.getCode').attr('disabled', true);
$('.getCode').css({
background: '#d8d8d8',
color: '#707070',
});
$('.getCode').text(count + 's');
}
count--;
}, 1000);
});