<td class='area'>
<input type='hidden' class='area_id' value='{$area_id}'>
<select class='area_edit'></select>
<button class='area_edit ok_btn' text='OK'>OK</button>
<label id='area_name'>{$area_name}</label>
<td>
$(".ok_btn").click( function(){
//console.log("ok_btn clicked")
//console.log( $(this).parent().html())
var parent = $(this).parent();
if ( parent.hasClass("area"))
{
//console.log("area")
var new_area_name = parent.find(".area_edit option:selected").text();
var new_area_id = parent.find(".area_edit option:selected").val();
console.log(new_area_name)
parent.find(".area_id").val( new_area_id );
parent.find("#area_name").text( new_area_name );
parent.find("#area_name").show();
parent.find(".area_edit").each(function(){$(this).hide()})
$(this).hide();
}
...
})