jQueryでselectboxなどプルダウンのオリジナルを用意しておき、
そのHTMLをコピーして使いまわしたい時のサンプルメモ。
<div id="list_select">
{html_options name="list_select" options=list_select_list selected=$session->post.list_select_id}
</div>
上記のようにSmartyなどでフォームを作っている場合などに有効!
var this_id = "";
$j.each(txtArr, function() {
this_id = String(this);
$j("#list_select").children().clone(true).appendTo($j("#list_select-" + this_id + " > .list_select_append"));
}
Selectボックスにはidとclassを設定しておき、class名を毎回変更させ、
2回目・3回目と繰り返すうちにばいばいに増えないようにしてます。