<style> .stop { background-color: #FF2D2D; 80px; height: 30px; line-height: 30px; text-align: center; border-radius: 4px; margin: 15px 10px; color: #fff; .p2 { display: none; } } </style> <div class="stop"> <p class="p1">暂停直播</p> <p class="p2">开始直播</p> </div> <script> var pause = true; // 点击暂停直播按钮暂停 $('.stop').click(function () { if (pause) { pause = false $('video').trigger('pause'); $('.p1').css({ "display": "none" }) $('.p2').css({ "display": "block" }) } else { pause = true $('video').trigger('play'); $('.p2').css({ "display": "none" }) $('.p1').css({ "display": "block" }) } }) </scrpt>