<script>
$(function()
{
$( "#dynabutton" ).button(
{
icons:
{
primary: "ui-icon-gear"
},
text: false
});
$( "#swap" ).button(
{
icons:
{
primary: "ui-icon-locked"
},
text: true
}).click(function(event)
{
// change #dynabutton icon from
// "ui-icon-gear"
// to:
// "ui-icon-locked"
});
});
</script>
<div class="demo">
<button id="dynamic_button">Button with gear icon</button>
<button id="swap">Swap icons</button>
</div>
单击#swap
按钮时,我想将与from关联的图标( jQueryUI 图标)切换为。#dynabutton
ui-icon-gear
ui-icon-locked
但不知道是否支持?