2

I have 4 inputs 3 of them are hidden. What I want is whenever user will the "Add More Pics". It will show the hidden inputs as many as time link is clicked. I dont have idea how it will work in Jquery? If someone helps I would be thankful.

<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>
4

1 に答える 1

1

これを試して:

$('#AddMore').click(function(e){
   e.preventDefault();
   $('input[type="file"]:hidden:first').show()
})

デモ

于 2012-07-14T00:39:07.427 に答える