html - How can I append a div in jquery right after some text? -
i have jquery script:
$(document).ready(function() { $("#timezone").html("sssssss"); });
and html:
<p>lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum <div id="timezone"></div></p>
so far result of is:
lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum sssssss
but want have it:
lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum sssssss
how can it? here's fiddle: http://jsfiddle.net/mwfplqm7/1/
use span
instead of div
. can't use divs inside p
element.
<p>lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum <span id="timezone"></span></p>
your browser outputs html div
outside of p
element because invalid html markup , anyway div
block element.
Comments
Post a Comment