C
C
Captain Cocoa2021-06-07 11:38:42
JavaScript
Captain Cocoa, 2021-06-07 11:38:42

How to return prop('readonly', true) on click outside input?

Hello everyone, by default the input is not editable, when you click on the input it becomes editable.
The question is, how to block it again when clicking outside the input?

Sample code: https://jsfiddle.net/pq496vje/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jamtuson, 2021-06-07
@RadCor

focusin & focusout

S
Spartak (Web-StyleStudio), 2021-06-07
@Spartak-2205

You can use the closest() function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question