I have multiple input elements like this
<input type="submit" name="top[1]" value="A"><br>
<input type="submit" name="top[2]" value="B">
the id's are added dynamically. How can I select all input's with name top[*] ?
The following jQuery code does not work in my case:
$('input[name="top[]"]').click(function(e){
alert("Hello");
e.preventDefault();
});
It would work, if I remove the numbers from the top array. Here is the corresponding jFiddle. How can I get it working with keeping the fixed id's in my input fields?