我正在尝试使用收音机显示和隐藏form
元素。我做了一个尝试,但仍然无效。谁能给我一些指导?
$('input[name="radio-3"]').click(function(){
if ($(this).attr("id") == "radio-3") {
$("details").show();
} else {
$("details").hide();
}
});
<div id = "radioButton">
<input type="radio" name="radio-1" id="radio-3">
<label for="radio-3">I want you to create my artwork</label>
</div>
<div id="details">
<form>
Please leave your name:<br>
<input type="text" name="firstname"><br>
Email:<br>
<input type ="email" name ="email"><br>
</div>
<div id="detailsSecond">
Please leave us a description of your artwork brief: <br>
<textarea name = "textarea" rows="10" cols="50">Write something here</textarea>
</form>
</div>