I am trying to auto select text in an input field when it is clicked, but when the field is disabled the auto select doesn't work.
Here is my Html:
<input type="text" class="form-control" ng-model="gameId" select-on-click disabled="true">
And here is my JavaScript:
angular.module('Admin').directive('selectOnClick', function(){
return {
restrict: 'A',
link: function(scope, element, attrs){
element.on('click', function(){
this.select();
});
}
};
});
I would like the text to be selectable when the form is disabled, how can I do that?