EasyUI Forum
April 28, 2024, 08:39:08 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Problem with menu appendItem on: July 06, 2011, 07:26:04 AM
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.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!