我有这个脚本来附加一组输入字段。它工作正常,但我的问题是每次单击页面中间的附加按钮时,页面都会跳转到页面顶部。我怎样才能阻止它跳到顶部?抱歉,这是附加脚本:
var count = 0;
$(function(){
$('a#add_field').click(function(){
count += 1;
$('#activation').append(
'<div id="features_remove" style="float:left; width: 11%; margin-left:115px;">'
+'<label>features remove</label>'
+'<select id="features_remove' + count + '" name=features_remove' + count + '" class="input-medium" >'
+'<option value="" selected=" " > </option>'
+'<option value="MPP" >MPP</option>'
+'<option value="50 Data" >50 Data</option>'
+'<option value="Navigation" >Navigation</option>'
+'<option value="Insurance" >Insurance</option>'
+'<option value="Road Side Assistance" >Road Side Assistance</option>'
+'</select>'
+'</div>'
);
});
});
是的,它是一个按钮
<a href="#" class="btn btn-mini btn-danger" id="add_field"><span>Add In-Store Activation</span></a>