js代碼:
<script type="text/javascript">
$(document).ready(function(){
$("#feng01").click(function(){$("#feng01").append( "<b>Single:</b> " + $("#single").val() + " <b>Multiple:</b> " + $("#multiple").val().join(", ")); });
$('#dingyue').click(function(){$.post("posted.aspx",{texx:$('#tongxun').val()},function(data){$('#basicModal').html(data)});});})
</script>
html代碼
<div>
<asp:TextBox ID="tongxun" runat="server" Width="120px" >請輸入信箱訂閱:</asp:TextBox>
<a id="dingyue" >訂閱</a><br />
<p id="feng01">點擊我</p><br/>
<select id="single">
<option>Single</option>
<option>Single2</option>
</select>
<select id="multiple" multiple="multiple">
<option selected="selected">Multiple</option>
<option>Multiple2</option>
<option selected="selected">Multiple3</option></select>
</div>
poset.aspx頁面直接使用Response.Write()方法返回資料就可以了
jquery出來文本和html代碼的方法
html元素
html();
html(val);
表單
val()
val(val)
html元素屬性
attr(key,value);
attr(key,fn);
attr(name);
attr(properties);
removeAttr(name);
html常值內容
text();
text(val);