+ 2
I want to have this effect like whenever I click on edit button it automatically takes user to input field to edit it[solved]
Also when the user clicks outside it makes the field uneditable(or disabled) again https://code.sololearn.com/W8VYwH7GUWiu/?ref=app
4 Antworten
+ 4
Give the input element focus.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus
+ 1
The second thing I wanted was when I click outside it should become uneditable which now I figured out can be done by eventlistener of "blur"
0
FOCUS MAN FOCUS. you got this, you can do it if you put your mind to it.... FOCUS!!!!!
0
SappyB lol man I got that when he mentioned but I was answering my second question which was that I mentioned it can't be done by htmlElement.focus() cause I wanted that when input field loses focus then it should be uneditable