フォームに多くの選択があります。
フォームのいくつかの選択にオプション「その他」を追加したいと思います。「その他」を選択すると、非表示の入力が表示されます。
$(document).ready(function(){
$(".SelectOther").append('<option value=-1>Other</option>');
$(".OtherDiv").hide();
$(".SelectOther").change(function()
{
if($(".SelectOther option:selected").text() == "Other")
{
$(".OtherDiv").show("slide", { direction: "up" }, 1000);
}
else
{
$(".OtherDiv").hide("slide", { direction: "down" }, 1000);
}
});
});
このコードはまだテストしていませんが、非表示の「OtherDiv」がすべて開きます
すべての選択は、テーブル内の TD 内にあります。
「その他」を選択すると、その TD 内の非表示の入力のみが表示されるようにするにはどうすればよいですか?