Select text on click of input field + ios not working

select text on click of input field + ios not working

Be great if you could put together a little codepen, www.codepen.io, to replicate this.

.directive(‘selectOnClick’, function () {
return {
restrict: ‘A’,
link: function (scope, element, attrs) {
element.on(‘click’, function () {
this.select();
});
}
};
})

This is the code i used . it works for android but not working in ios

Read this. It’s Safari’s fault. Input elements don’t have the select method in Safari. In Mozilla developer network there is more information about selecting text.

Please, next time use the “Preformatted text” option (ctrl + k) to show code.

Thank you. Its works for me.