我已经按钮可以设置类似的标题:jQuery的 - 更改按钮
<button id="invOn2" style="float: left;">Item 2</button>
按钮是一个对话框里,我试图为正在打开的对话框更改按钮的标题:
$('#invOn2').button("option", "label", "shwaf");
这不是工作,出了什么问题?
的建议还没有做过的呢,我去阐述什么即时通讯的结构做:
// jQuery的设置
$(function() {
$('#invOnBox').dialog({
autoOpen: false,
resizable: false,
height: 350,
width: 300,
});
$('#invOnButton').click(function() {
$('#invOn1 button').html('shwaf');
$('#invOnBox').dialog('open');
return false;
});
});
//的invDialog和内部按钮
<div id="invOnBox" title="Inventory">
<button id="invOn1" style="float: left;">Item 1</button>
</div>
// the invOnButton
<button id="invOnButton" style="float: left;">Inventory</button>
谢谢!
http://stackoverflow.com/questions/987967/how-to-change-an-elements-title-attribute-using-jquery – FosterZ 2010-09-08 05:34:22