Я устал следующий Javascript, чтобы принести кнопки родительского TD, но я не нашел его на работуПолучить DIVs родительскую TD с помощью JQuery
$(document).on('click','.editable-submit',function(){
alert($(this).closest('span').html());
});
Приведенный выше код Оповещения «не определено», следующее знак вверх. В этой отметке целью является «editable-submit». Мне нужно, чтобы javascript должен был указать значение <td>, которое является «Выходным контентом» в этом примере.
<td>
<span class="xedit editable editable-click editable-open" data-original-title="" title="">
Output Content
</span>
<div class="popover fade top in editable-container editable-popup" style="top: 12px; left: 0px; display: block;">
<div class="arrow" style="left: 23.007246376811597%;">
</div>
<h3 class="popover-title" style="display: none;">
</h3>
<div class="popover-content">
<div>
<div class="editableform-loading" style="display: none;">
</div>
<form class="form-inline editableform" style="">
<div class="control-group form-group">
<div>
<div class="editable-input" style="position: relative;">
<input type="text" class="form-control input-sm" style="padding-right: 24px;">
<span class="editable-clear-x">
</span>
</div>
<div class="editable-buttons">
<button type="submit" class="btn btn-primary btn-sm editable-submit">
<i class="glyphicon glyphicon-ok">
</i>
</button>
<button type="button" class="btn btn-default btn-sm editable-cancel">
<i class="glyphicon glyphicon-remove">
</i>
</button>
</div>
</div>
<div class="editable-error-block help-block" style="display: none;">
</div>
</div>
</form>
</div>
</div>
Вы имеете в виду 'Data' в том, что' td' не выбирая фактического 'td'? или выбрав 'td'? –
'$ (this) .closest (" span ")' ищет родительский '', которого не существует. – Sampson