I have various. How do I add a new list based on the button clicked in that particular ul How to get the ul of the button saved clicked and create and add li to that ul?
<ul id ="list1"><li>item1</li><input type= "Button" id = "test1" value = "Save"></ul>
<ul id ="list2"><li>item11</li><input type= "Button" id = "test11" value = "Save"></ul>
the Jquery code is as follows:
$(document).ready(function(){
$("#list :button").click(function(){
var text = $(this).val();
if ( text == "Delete") {
$(this).parent().remove();
}
if(text =="Save")
{
//How to get the UL of the button saved clicked and create and add li to that UL
}
});
});