Hi guys i am trying to implement jQuery in my website. I have used name property of a control to bind an event like below
$('[name = "OCCUPATION"]').typeahead({
source: function (query, result) {
var name = "test";
$.ajax({
url: "@Url.Action("lookupQuestionOption", "Home")",
data: { Key: query, type: name},
dataType: "json",
type: "GET",
success: function (data) {
result($.map(data, function (item) {
return item;
}));
}
});
}
});
Now i want this single event handler for multiple controls, like it can be OCCUPTION2 , OCCUPTION3, OCCUPTION4, OCCUPTION5...
So the code may be like
$('[name = "OCCUPATION,OCCUPATION2,OCCUPATION3,OCCUPATION4"]').typeahead({
I have tried the above but it's not working. Please help!
$('[name="OCCUPATION"],[name="OCCUPATION2"]')