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
Post a Comment