我有一个jQuery的代码行输出一些HTML到一个div。事情是,HTML有一些按钮标签需要一个包含称为postID的JavaScript变量的ID。jQuery如何获得一个变量里面的按钮ID标签里面.html函数
$('#Message_' + postID).css('visibility','visible').html('').html('I need the buttons to have an ID with the postID variable!<br /><button type="button" id="remindMe_" + postID">Remind Me</button><button type="button" id="cancelMe" + postID">Cancel</button>').prependTo('#buttons_' + postID);
所以现在的问题是,我怎么修复
.html('<button type="button" id="remindMe_" + postID">Remind Me</button>')
为什么会有人下来率呢?这是一个合法的问题! – Sweepster 2012-03-29 03:32:54