Wrap items in h3

User
$('#addonsList').html(apiResult.addons.join(''));
wrap with h3 each ,ist
Assistant
To wrap each item in the `apiResult.addons` array with an “ tag before inserting them into the `#addonsList` element, update your code like this:

$('#addonsList').html(
  apiResult.addons.map(function(addon) {
    return '<h3>' + addon + '</h3>';
  }).join('')
);

This wraps **each** addon in an “ tag and injects them all into the `#addonsList` container.

Leave a Comment

Your email address will not be published. Required fields are marked *