参考链接: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>
时间: 2024-10-19 20:27:32