Change items userdata

Select Item  
(Click menu item to select)
Current UserData ("data")  
UserData Name  
UserData Value  
</> Source
<!DOCTYPE html>
	<title>Change items userdata</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
		var myMenu;
		var mid;
		function doOnLoad() {
			myMenu = new dhtmlXMenuObject({
				parent: "menuObj",
				icons_path: "../common/imgs/",
				xml: "../common/dhxmenu.xml",
				onclick: menuClick
		function menuClick(id) {
			document.getElementById("item").innerHTML = id + " ("+myMenu.getItemText(id)+")";
			var ud = myMenu.getUserData(id, "data");
			document.getElementById("item_ud").value = (ud!=null?ud:"");
			mid = id;
		function update() {
			var data = document.getElementById("item_new_ud").value;
			myMenu.setUserData(mid, "data", data);
<body onload="doOnLoad()">
	<div style="height: 250px;"><div id="menuObj"></div></div>
		<table border="0" cellspacing="2" cellpadding="2">
				<td>Select Item</td>
				<td width="10">&nbsp;</td>
				<td><div id="item">(Click menu item to select)</div></td>
				<td>Current UserData ("data")</td>
				<td><input id="item_ud" type="text" value="" disabled="true"></td>
				<td>UserData Name</td>
				<td><select disabled><option>data</option></select></td>
				<td>UserData Value</td>
				<td><input id="item_new_ud" type="text" value=""> <input type="button" value="Update" onclick="update();"></td>


Check documentation to learn how to use the components and easily implement them in your applications.