How can I create a function out of this? Im using append & prepend to assign elements, would like to keep this as DRY as possible and be able to customize each output text.
let $paragraph = $('<p>', {
'class': 'my-class',
text: 'some-text'
});
let $paragraph2 = $('<p>', {
'class': 'my-other-class',
text: 'some-other-text'
});
My goal is to be have a easy setup for outputing codeblocks like:
<p>
Instagram
<span class="instagram">@instagram</span>
Twitter
<span class="twitter">@twitter</span>
Github
<span class="github">@github</span>
</p>