Assuming the "Badge Name: " phrase is constant, one approach is using CSS :before
pseudo element to generate the content as follows:
EXAMPLE HERE
.tag:before {
content: "Badge Name: ";
font-weight: bold;
}
Hence you could remove that phrase from your script:
wrapper.append('<div class="tag" >'+ item.badgename + '</div>'+ '<br>');
Another option is wrapping that phrase by an inline wrapper (a <span>
element) and use .tag span
selector to apply the proper declarations:
wrapper.append('<div class="tag" >'+ '<span>Badge Name:</span> '+ item.badgename + '</div>'+ '<br>');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…