我这里有这段代码:
var photo = place.photos[0].getUrl({ 'maxWidth': 50, 'maxHeight': 50 });
var sideClick = jQuery("<a class=side_click href='#'></a>");
$(sideClick).html(place.name+place.rating);
$("#side_bar").append("<div class='elemenat'><div class='draggable'><img style='margin-left:3px; margin-top:5px;' src="+ photo +" width='46' height='42' /></div><div class='elementname'>").append(sideClick).append("</div></div>");
$(sideClick).on("click", function() {
markers[i].modalWindow_.getDetails(markers[i].place_);
});
}
这段代码呈现:
<div id="side_bar">
<div class="elemenat">
<div class="draggable ui-draggable">
<img style="margin-left:3px; margin-top:5px;" src="https://lh6.googleusercontent.com/-T0_fJX5zza0/UdSnOaucZvI/AAAAAAAAAFc/gQhK3IbHJfY/w50-h50-s0/Small%2BLogo.png" width="46" height="42"></div>
<div class="elementname"></div></div>
<a class="side_click" href="#">James Cook Hotel Grand Chancellor3.6</a>
我必须如何更改 js 代码以呈现 html 将<a class="side_click" href="#">James Cook Hotel Grand Chancellor3.6</a>
在哪里<div class="elementname"></div>
必须像这样呈现:
<div class="elementname">
<a class="side_click" href="#">James Cook Hotel Grand Chancellor3.6</a>
</div>