有多个事件日期div。jQuery:拆分字符串并将html附加到拆分元素
HTML:
<div class="event-dates">Aug 28</div>
<div class="event-dates">Aug 28</div>
<div class="event-dates">Aug 28</div>
<div class="event-dates">Aug 28</div>
JQuery的:
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery(".event-dates").each(function() {
jQuery(this).html(jQuery(this).html().replace(/ /g, '<br />'));
});
});
我要像第一附属输出image.is有可能拆分字符串,并用HTML加上?
或
任何其他方式来获得这样的输出?在第一图像显示
预期结果
它看起来像一些CSS问题http://jsfiddle.net/arunpjohny/8Vx3V/1/ –
了输出像attched图像您的代码,但我想添加HTML代码到它。 8 25 –