I'm trying to use a jQuery selector that finds all input fields with a specific name:
$('input[name=Filter']).click(function() {
// do something
});
This should match the following items:
<input type="radio" name="Filter" value="A" />
<input type="radio" name="Filter" value="B" />
This is working fine. The problem I am having is that my names are dynamically generated by ASP.net MVC and the names have a period:
<input type="radio" name="Parent.Filter" value="A" />
<input type="radio" name="Parent.Filter" value="B" />
I tried to write the following selector:
$('input[name=Parent.Filter]').click(function() {
});
I am getting the following error:
Uncaught Syntax error, unrecognized expression: [name=Parent.Filter]
How can I write this expression so that it works properly?
$('input[name="Parent.Filter"]')'input[name*="Filter"]'?