0
からのデータを使用して、フォームの入力を記入してください。jQueryのは - 私は、「タイトル」、「LOC」と「ボタンの追加」を含むアイテム</p> <p>それぞれのリストを持っているHTML
私は右の「LI」の値は、以下のフォームに表示されることを希望「ボタンを追加」をクリックします(各値識別した:「データ型は、=」)
<li>
<div class="timeline-badge">
</div>
<div class="timeline-panel-pointer">
<div class="timeline-heading">
<h4 class="timeline-title dropdown">
<span data-type="title">some text here</span>
</h4>
<p><small class="text-muted"><span data-type="loc">Rome</span></small></p>
</div>
<p class="mt20">
<button type="button" class="btn btn-info secBtn" data-act="new" data-toggle="modal" data-target="#manageSec-model">New Section</button>
</p>
</div>
</li>
<li>
<div class="timeline-badge">
</div>
<div class="timeline-panel-pointer">
<div class="timeline-heading">
<h4 class="timeline-title dropdown">
<span data-type="title">some text here 2</span>
</h4>
<p><small class="text-muted"><span data-type="loc">Milan</span></small></p>
</div>
<p class="mt20">
<button type="button" class="btn btn-info secBtn" data-act="new" data-toggle="modal" data-target="#manageSec-model">New Section</button>
</p>
</div>
</li>
FORM:
$(document).on('click','.secBtn',function(e) {
alert($(this).parents("li").find("data-type=title").val());
});