Code:
<script>
var arrs = ["test1","test1","test1","test1"];
for (var i=0;i<arrs.length;i++) {
$("#div_menu").menu({
text:arrs[i],
onclick:function() {alert("ok")}
});
}
</script>
<div id="div_menu" style="width:100px;"></div>
with this code, I want to alert "ok" by clicking the menu.but i just get wrong:the alert function just fires once when the menu initialized,bu no function by clicking the menu.