0
我的一個網頁進行不同形式的ID下的相同元素,如元素類型取代
<form method="post" action="" style="" enctype="application/x-www-form-urlencoded" id="comment-form-1">
<textarea rows="1" cols="45" id="body" name="body" ></textarea>
<button class="post-comment-sml" type="submit" id="submit" name="submit"></button>
</form>
<form method="post" action="" style="" enctype="application/x-www-form-urlencoded" id="comment-form-2">
<textarea rows="1" cols="45" id="body" name="body" ></textarea>
<button class="post-comment-sml" type="submit" id="submit" name="submit"></button>
</form>
---
<form method="post" action="" style="" enctype="application/x-www-form-urlencoded" id="comment-form-n">
<textarea rows="1" cols="45" id="body" name="body" ></textarea>
<button class="post-comment-sml" type="submit" id="submit" name="submit"></button>
</form>
在這裏,我可以代替所有VARIOS形式提交按鈕與普通按鈕式如下
多種形式<form method="post" action="" style="" enctype="application/x-www-form-urlencoded" id="comment-form-1">
<textarea rows="1" cols="45" id="body" name="body" ></textarea>
<button class="post-comment-sml" type="button" id="submit" name="submit"></button>
</form>
HTML需要一些愛。元素不能共享相同的ID。 – 2011-02-09 06:28:43