-2

I have an input set to read-only

<input type="text" placeholder="{some variable}" class="form-control" readonly>

When I open this in chrome, I cannot copy the text, which is important. I have tried also 'disabled' status, but the same issue.

What is the way to set the code so I can copy the value from the browser?

Big thanks!

1
  • placeholder can not be copied, value can Commented Mar 29, 2022 at 8:49

1 Answer 1

3

You need to set the value of that input-field instead of the placeholder:

<input type="text" value="{some variable}" class="form-control" readonly>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.