jquery如何实现进入页面只展示对应的字段数据 用户点击编辑之后所有的input select

jquery如何实现进入页面只展示对应的字段数据 用户点击编辑之后所有的input select才可以编辑,求个思路


莫回无
浏览 710回答 2
2回答

吃鸡游戏

disabled

慕容森

<!DOCTYPE html><html><head>&nbsp; <meta charset="UTF-8">&nbsp; <title>Document</title>&nbsp; <style type="text/css">&nbsp; &nbsp;&nbsp;&nbsp; </style></head><body>&nbsp; <input type="text">&nbsp; <input type="text">&nbsp; <input type="text">&nbsp; <button class="btn1">增加</button>&nbsp; <button class="btn2">移除</button>&nbsp; <script src="js/jquery.min.js"></script>&nbsp; <script>&nbsp; &nbsp; &nbsp; $(".btn1").click(function(){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(":input").attr("readonly","readonly");&nbsp; &nbsp; &nbsp; })&nbsp; &nbsp; &nbsp; $(".btn2").click(function(){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(":input").removeAttr("readonly");&nbsp; &nbsp; &nbsp; })&nbsp; </script></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript