Example:
function getNewElement(elementName, elementClass) {
return $('<p>')
.addClass(elementClass)
.text(elementName);
}
And then i can reuse it like:
const paragraph = getNewElement('test', 'some-class');
const paragraphSecond = getNewElement('test2', 'some-class2');
Is there any way to run the code or any similar approach ? Thanks