I want to prepend the following within a div using Jquery:
-
You can't.
Despite the abstraction it offers, jQuery doesn't operate on HTML, it operates on a DOM (where there are no start tags and no end tags, just elements).
Build the DOM you want to prepend, and then prepend it.
var $wrapper = $('<div class="section map-wrapper">');
var $inner = $('<div class="wrapper section group inner-map-wrapper">')
var $col = $('<div class="col span_12_of_12">');
$inner.prepend($col);
$wrapper.prepend($inner);
$('.mpfy-tags-list').prepend($wrapper);
讨论(0)