Level 32
using jquery, provid an id to the input
$("#myTextBox").focus();
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have this method
comment (id) {
this.disable = true;
this.$http.post('/ajax/' + this.postId + '/comment', { body: this.body }).then((response) => {
eventHub.$emit('comment-added', response.body)
this.body = null
this.disable = false
})
}
and this input
<input type="text" v-model="body" @keyup.enter="comment(postId)" :disabled="disable !== false">
how do I focus on the input after the input type gets enabled?
Please or to participate in this conversation.