Answer the question
In order to leave comments, you need to log in
Is it possible to make a "dynamic" jQuery selector?
the plugin works like this:
$(function(){
$('#editable').editable('click', function(e){
console.log(e.value);
});
});
<span id="editable">Текст </span>
<table class="editable">
<tr>
<td id="t-1-1">Текст</td>
<td id="t-1-2">Текст</td>
</tr>
<tr>
<td id="t-2-1">Текст</td>
<td id="t-2-2">Текст</td>
</tr>
<tr>
<td id="t-3-1">Текст</td>
<td id="t-3-2">Текст</td>
</tr>
</table>
$(function(){
$('.editable #t-1-1').editable('click', function(e){
console.log(e.value);
});
$('.editable #t-1-2').editable('click', function(e){
console.log(e.value);
});
$('.editable #t-2-1').editable('click', function(e){
console.log(e.value);
});
$('.editable #t-2-2').editable('click', function(e){
console.log(e.value);
});
$('.editable #t-3-1').editable('click', function(e){
console.log(e.value);
});
$('.editable #t-3-2').editable('click', function(e){
console.log(e.value);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question