Sachin Prasad Sachin Prasad - 7 months ago 46
HTML Question

Replace an input value next to span element

I have to this input:

<input type="text" id="my_input" />

After a user enters anything in the input I have to append this next to the span.

<p id="patient_provider" >

The code I used is(It should be something like below):


But this is not working.

It is showing something like:

[object HTMLSpanElement] Sam

Also please note :

There are some css implemented on the span directly and I can not add another span


$('#patient_provider').children()[0] is an element and is converted to a [object HTMLSpanElement] string

The right is: