Im populating/inserting jsonObjects[i].type in a menu with a div called #changetotypes. Im getting values r, c and e from jsonObjects[i].type in a menu, know I wanna be able to click on does value r, c and e and change the values to the clicked value. Know I can click on a object and It is displaying the value r, c or e.
So If I click on a object It gets/display the value jsonObjects[i].type r, c or e in a menu that the object have. Know how can I change my clicked objects value example from r to c?
<li>
    <a href="#">Typs</a>
        <ul>
            <li>
                <a href="#"><span id="currenttype" title=""></span></a>
                <ul id="changetotypes"></ul>
            </li>
        </ul>
</li>
function populateTypes() {
    for(i = 0; i < jsonObjects.length; i++) {
        if(availableTypes.indexOf(jsonObjects[i].type) < 0) {
            availableTypes.push(jsonObjects[i].type);
            $("#changetotypes").append('<li><a href="#">' + jsonObjects[i].type + '</a></li>');
        }
    }
}
 
     
     
     
    