coffeescript - What is the correct syntax for concatenating strings within jquery replaceWith -
i have following html markup
<body> <div class="old-wrapper"> ...lots of stuff </div> </body>
i need replace coffeescript function give following markup
<body> <div class="new-wrapper"> <input type="text" class="date-picker"> </div> </body>
i need use .old-wrapper
target
my coffeescript function looks this
jquery -> $(".old-wrapper").repacewith( $("<div class='new-wrapper'>") + $("<input type='text' class='date-picker'>").datepicker + $("</div>") )
what correct way concatenate these strings within replacewith function? (sorry basic javascript syntax question, javascript knowledge limited)
you have syntax error start with:
$("<div class="wrapper>") ^ ^ ^ open close ???
the rest of code kind of invalid well.
try this: $(".date-wrapper").wrapinner('<div class="wrapper" />');
you should have @ tutorials section on site: http://docs.jquery.com/tutorials
Comments
Post a Comment