首页 > Web开发 > 详细

jQuery 动态更改按钮上的图标或文字

时间:2017-03-07 17:55:10      阅读:847      评论:0      收藏:0      [点我收藏+]

参考链接:http://stackoverflow.com/questions/5580616/jquery-change-button-text

<input type=‘button‘ value=‘Add‘ id=‘btnAddProfile‘>
<script>
$("#btnAddProfile").attr(value, Save); //versions older than 1.6
</script>

<input type=‘button‘ value=‘Add‘ id=‘btnAddProfile‘>
<script>
$("#btnAddProfile").prop(value, Save); //versions newer than 1.6
</script>

<!-- Different button types-->

<button id=‘btnAddProfile‘ type=‘button‘>Add</button>
<script>
$("#btnAddProfile").html(Save); // 支持修改图标
$("#btnAddProfile").text(Save); // 只支持修改文本
</script>

 

jQuery 动态更改按钮上的图标或文字

原文:http://www.cnblogs.com/shilxfly/p/6515959.html

(1)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!