どんな助けや提案も非常に高い評価を受けます。 [edit] In this way more number of field can be"> どんな助けや提案も非常に高い評価を受けます。 [edit] In this way more number of field can be"> どんな助けや提案も非常に高い評価を受けます。 [edit] In this way more number of field can be" />
私はjQueryの初心者です。私はこのような形をしている
--Select-- a b c d e
今私は "a"をクリックすると、入力フィールドがちょうど別の場所に来るようになります
<input type="text" name="a" />
どんな助けや提案も非常に高い評価を受けます。
[edit] In this way more number of field can be added at a time just like this code
<input type="text" name="a"/> <input type="text" name="c"/> <input type="text" name="d"/>
name
input
select
$(function() { $('select[name="menus"]').change(function() { //fetch the selected value from the dropdown var value = $(this).val(); //find the input element with name attribute equal to //the selected value from the dropdown and add some class to it $('input[name="' + value + '"]').addClass('foo'); }); });
ドロップダウンリストの選択が変更されたら、 foo クラスを対応するinput要素に追加します:
foo
<input type="text" name="a" class="foo" />
デモをご覧ください。