您可以跟踪点击次数并禁用第四个按钮:
$(document).ready(function() {
let count = 0;
$('#btn').click(function(){
count++;
if(count == 4)
$(this).attr("disabled", true);
})
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button id="btn">Click</button>