Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
onchange イベントを使用して、現在のスパンのテキストを隠しフィールドにコピーしています。onchange イベントが機能しないのはなぜですか? http://jsfiddle.net/Hunter4854/qfdvE/
innerTextjQuery メソッドではありません。使用してtextください。また、非表示のコンテンツをスパンに割り当てて、逆方向に進んでいます。したがって、これの代わりに:
innerText
text
$('#span').innerText($('#dropdown').val());
これを行う:
$('#dropdown').val($('#span').text());