「 class=div 」内のテキストを強調表示したときにツールチップを表示したい。私は次のHTMLを持っています:
<div class='test'>Test</div>
<div class='tooltip'>Tooltip 1</div>
<div class='test'>Test 2</div>
<div class='tooltip'>Tooltip 2</div>
<div class='test'>Test 4</div>
<div class='tooltip'>Tooltip 4</div>
および次の JavaScript:
<script type="text/javascript">
$(document).ready(function () {
$('div.test').each(function () {
var tooltipHtml = //NEED to figure out how get the html of the Tooltip div below this current div
$(this).qtip({
content: {
text: tooltipHtml
},
style: { width: 450 }
});
});
});
「次の」ツールチップ div から html を取得するにはどうすればよいですか?