javascript - How can i insert html element between start and end tag of another html element using jquery -


i have textbox :

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

i want add span between input element using jquery below:

    <input type="text"><span>added span</span></input> 

how can achieve that?

i answer 3 questions:

how append html in element?

use jquery: $('div').append('<span>added span</span>');

how add placeholder input element?

use following markup: <input type="text" placeholder="my placeholder" /> (browser support: http://caniuse.com/input-placeholder)

how add text default in input?

use following markup: <input type="text" value="my text" />


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -