I want to prepend the following within a div using Jquery:
<div class="section map-wrapper">
<div class="wrapper section group inner-map-wrapper">
<div class="col span_12_of_12">
To do this I'm using the following Jquery:
// prepend a 'previous' button to all form-rows except the first
$('<div class="section map-wrapper">').prependTo($('.mpfy-tags-list'));
$('<div class="wrapper section group inner-map-wrapper">').prependTo($('.map-wrapper'));
$('<div class="col span_12_of_12">').prependTo($('.inner-map-wrapper'));
The problem with this is that it's closing each div, which I don't want it to do. How can I prepend the html at the top exactly as it is? I'll then append the closing divs later on.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…