Hello,
This is the html i am using
<tr>
<td>No.</td>
<td id="2" class="editable">data1</td>
<td id="2" class="editable">data2</td>
<td>Usage Left</td>
</tr>
<!-- Multiple rows with different ids -->
and this is my javascript
$(function(){
$('.editable').editable({onSubmit:Update});
function Update(){
var id = $(this).parent('td').attr('id');
var title = $(this).text();
$.ajax({
type: 'post',
url: 'update.php',
data: 'title=' + title + '&id=' + id,
success: function(response) {
$('#response').fadeIn('1000').empty().append(response);
}
});
}
});
I want to get the value of the ids of class editable, this is a inline edit plugin i am using i am able to collect the data1 and data2 values but for id i am getting undefined.
What is wrong with my code.
Thank You.