我有 4 个输入,其中 3 个是隐藏的。我想要的是每当用户将“添加更多图片”时。单击链接时,它将显示隐藏的输入。我不知道它在 Jquery 中如何工作?如果有人帮助我将不胜感激。
<html>
<head>
</head>
<body>
<form>
<input type="file" id="pic1" />
<input type="file" style="display:none;" id="pic2" />
<input type="file" style="display:none;" id="pic3" />
<input type="file" style="display:none;" id="pic4" />
<a href="#" id="AddMore">Add More Links</a>
</form>
</body>
</html>
最佳答案
试试这个:
$('#AddMore').click(function(e){
e.preventDefault();
$('input[type="file"]:hidden:first').show()
})
关于javascript - 如何通过 Jquery 单击链接添加输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11479979/