Reputation: 17701
I have a kendo ui control that create following html syntax on runtime
<input id="ItemSearch" name="ItemSearch" style="width:115px;" type="text">
How can I apply the maxlength HTML5 property to it using javascript
When I use following I am getting Cannot call method 'prop' of undefined
$('#ItemSearch').input.prop("maxlength", 2);
Upvotes: 0
Views: 77
Reputation: 337560
You don't need .input
as $('#ItemSearch')
has already selected that element. Try this:
$('#ItemSearch').prop("maxlength", 2);
Upvotes: 5