-1

How to de-select input value that was selected by .select() ?

The input is readonly

Have tried to use .blur() but the input value is still selected

const input = $('#'+input_id).select();
navigator.clipboard.writeText(input.val());
input.blur();
clarkk
  • 27,151
  • 72
  • 200
  • 340

1 Answers1

0

Instead of using blur you can use this:

input[0].setSelectionRange(0, 0);
DCodeMania
  • 1,027
  • 2
  • 7
  • 19