This article will share with you a JS sample code to implement clicking on the check box to change the display status of p. It has a good reference value and I hope it will be helpful to everyone. Let’s follow the editor to take a look, I hope it can help everyone.
First on the page:
元/L
元/L
元/L
Then the implementation in jquery
jQuery(document).ready(function($) { //是否添加活动内容 $("#isHaveActive").change(function(){ var p = $("#active"); p.css("display") === "none" && p.show() || p.hide(); });
Related recommendations:
JS click on the link to switch Implementation method of displaying hidden content
js method of clicking to select text_javascript skills
js click return to jump to the specified page implementation process_ javascript skills
The above is the detailed content of JS sample code to change p display status when clicking on checkbox. For more information, please follow other related articles on the PHP Chinese website!