user3475724
user3475724

Reputation:

Html input is not selected on click

I am adding input via jQuery but can't type anything in it, on click the default blue outline appears and disappears at once. What can be wrong?

jQuery:

$('#user_description').html('<input type="text" value="" />')

CSS:

#user_description input {
    width: 300px;
    height: 31px;
    background: #403a48;
    border: none;
}

Upvotes: 2

Views: 377

Answers (1)

P.S.
P.S.

Reputation: 16384

Try to use append instead of html like this:

$('#user_description').append('<input type="text" value="" />')

And take a look at this: http://api.jquery.com/append/

Upvotes: 1

Related Questions