日期:2014-05-16 浏览次数:20484 次
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTUxMTcwNzgxMGRkkfZMzAK1Mk0P7/h4kOOc2f+DpFk=">
</div>
<input style="cursor: pointer; " name="btnFuntype" ; value="点我" id="btnFuntype" class="selebg1" type="button">
</form>
<div ID="div1"></div>
<script language="javascript">
$('#btnFuntype').click(function(){
$(this).empty().after($('#div1').html());
$('#div1').hide();
});
</script>
------解决方案--------------------
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTUxMTcwNzgxMGRkkfZMzAK1Mk0P7/h4kOOc2f+DpFk=">
</div>
<input style="cursor: pointer; " name="btnFuntype" ; value="点我" id="btnFuntype" class="selebg1" type="button">
</form>
<script>
var divTest=document.createElement("div");
divTest.setAttribute("id","div1");
document.getElementById("form1").appendChild(divTest);
</script>
</body>