JQuery focus () does not move cursor to input field

I know that $('#siteTitle').focus() focuses on the input field that the siteTitle id siteTitle , and I also know that focus() causes the input to become the current active element of the document, thus being retrieved via document.activeElement . My problem is that I cannot type anything in the titleInput field, even though it focuses on it. My input has some formatting already applied to it and has a flickering watermark by default:

enter image description here

But there is no cursor in it, and worse than that, I cannot enter it. As I said, when I use document.activeElement , the input field is returned. Therefore, I am sure that he has a focus.

This is my HTML:

 <div class="titleWrapper"> <div class="titleInpWrapper"> <input type="text" name="title" id="titleInput" value="Site Name" tabindex='0' /></div> <p class="label"> What your site name?</p> <p class='alert titleStep'> </p> </div> 
+4
source share
1 answer

I think another piece of javascript code is interfering with your typing. Check this.

You can use the firefox add-on fireQuery add-on to see if other events are attached to it.

+3
source

All Articles