使用VMware搭载Linux镜像,并且在Linux镜像当中使用wordpress搭建完成个人博客?求大神回答?
jQuery中使用.Button()创建的按钮........
虽然其他答案会改变文本,他们会弄乱按钮的样式,事实证明,当一个jQuery按钮被呈现时,按钮的文本嵌套在一个范围内,例如
<button id="thebutton">
<span class="ui-button-text">My Text</span>
</button>
如果你删除了跨度并将其替换为文本(如其他示例中所示),则会丢失跨度和关联的格式。
所以你实际上需要改变SPAN标签内的文本,而不是按钮!
$("#thebutton span").text("My NEW Text");
或者(如果像我这样做是在点击事件)
$("span", this).text("My NEW Text");
取决于你正在使用的按钮类型
<input type='button' value='Add' id='btnAddProfile'>
$("#btnAddProfile").attr('value', 'Save'); //versions older than 1.6
<input type='button' value='Add' id='btnAddProfile'>
$("#btnAddProfile").prop('value', 'Save'); //versions newer than 1.6
<!-- Different button types-->
<button id='btnAddProfile' type='button'>Add</button>
$("#btnAddProfile").html('Save');
你的按钮也可以是一个链接。