I am working on a mobile website and I have a text input field.
I want it to be selected and copiable but not editable. When I add readonly
or onfocus="this.blur()"
it becomes unselectable. How can I achieve this?
I am working on a mobile website and I have a text input field.
I want it to be selected and copiable but not editable. When I add readonly
or onfocus="this.blur()"
it becomes unselectable. How can I achieve this?
Check this out.
Edit:
You can reassign text input value everytime it changes by adding input listener.
Working jsfiddle here.