企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <input type="button" value="显示" id="teacher_aptitude" res="1"/> <body> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/layer/3.1.0/layer.js"></script> <script> $(function () { //思路:通过在标签上加自定义的属性,改变其属性值来完成 $("#teacher_aptitude").click(function() { var flag = $(this).attr("res"); if(flag == 1){ $(this).attr({res:"2",value:"隐藏"}); }else{ $(this).attr({res:"1",value:"显示"}); //默认值是1 && 显示 } }); }); </script> </body> </html> ```