$(document).ready(function(){
var spotMax = 30;
if($(‘div.spot‘).size() >= spotMax) {$(obj).hide();}
$("input#add").click(function(){ addSpot(this, spotMax);
});
});
function addSpot(obj, sm) {
$(‘div#spots‘).append(
‘
‘ +
‘)
‘ ‘ +
‘ ‘ +
‘
.find("input.remove").click(function(){
$(this).parent().remove();
$(‘input#add‘).show();
});
if($(‘div.spot‘).size() >= sm) {$(obj).hide();}
};
$(‘#send‘).click(function(){
alert(‘Demonstration Only: submit disabled‘);
});
原文:http://www.cnblogs.com/chencheng365/p/4647406.html