I have the following html markup
<body>
<div class="old-wrapper">
...lots of stuff
</div>
</body>
I need to replace this with a coffeescript function to give the following markup
<body>
<div class="new-wrapper">
<input type="text" class="date-picker">
</div>
</body>
I need to use .old-wrapper
as the target
My coffeescript function looks something like this
jQuery ->
$(".old-wrapper").repaceWith(
$("<div class='new-wrapper'>") +
$("<input type='text' class='date-picker'>").datepicker +
$("</div>")
)
What is the correct way to concatenate these strings within the replaceWith function? (Sorry this is a very basic javascript syntax question, but my javascript knowledge is limited)