js代码如下 jq2.1.3
$("ul li").on("click",".votedel",function(){
vote_count--;
$(this).parent().remove();
});
html代码
<ul>
<span class="votetitleleft">选项:最多可填写<script type="text/javascript">document.write(vote_max);</script>个选项</span>
<span class="votetitleright"><input type="checkbox" id="voteconfig1">多选模式</span>
<li class="votechoice">
<input type="text" name="choice1"/><a class="votedel" title="删除"></a>
</li>
<li class="votechoice">
<input type="text" name="choice2"/><a class="votedel" title="删除"></a>
</li>
<span id="addchoice" title="增加一个选项" class="addchoice">+增加一个</span><span id="complete">完成</span>
</ul>来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/887/viewspace-3135660/ ,如需转载,请注明出处,否则将追究法律责任。