Avoid line break when using jquery append() or html()

hannah228

New Member
When i do this :\[code\]$("li").append("<span>A</span><span>B</span>");\[/code\]
Here is what I got if I look into the source code of my browser :\[code\]<li> <span>A</span> <span>B</span></li>\[/code\]
But I would like to have\[code\]<li> <span>A</span><span>B</span></li>\[/code\]
I need to display span on the same line in order to avoid displaying a white space between the two elements.With javascript innerHTML the problem is the same as jQuery use it for append and html function.Thank you for your help
 
Back
Top