日期:2014-05-16 浏览次数:20377 次
<style type='text/css'>
dl dt { width:100px; float:left; }
dl dd { margin-left:200px; }
</style>
<script type='text/javascript'>
var clone;
$(function() {
$('dl dd').click(function() {
$(this).html("<input type='text' /> <select><option value='Work'>Work</option></select> <span class='close'>x</span>");
clone = $(this).clone(true);
});
$('.class').live('click', function() {
$(this).parent().html('Add a phone number');
});
$('dl dd input').keydown(function() {
$('this').parent().append("<br /><span class='another'>Add another</span>");
});
$('.another').live('click', function() {
$(this).parent().parent().append(clone);
});
});
</script>
<dl>
<dt>Phone</dt>
<dd>Add a phone number</dd>
</dl>