div #1优先。
添加问题按钮
<div id="id-2" class name="data"><div>div #2</div><span>second.</span></div>添加问题按钮
<div id="id-3" class name="data"><div>div #3</div><span>third.</span></div>添加问题按钮
<div id="id-4" class name="data"><div>div #4</div><span>last.</span></div>添加问题按钮
</body>我想把id-3换成下一个id-4的div。我只知道id-3
发布于 2011-02-07 14:07:17
试试这个:
$('div').click(function()
{
$(this).html($(this).next('.data').html());
});我不确定next()是否会循环到开始,但值得一试。
https://stackoverflow.com/questions/4918209
复制相似问题