$(document).ready(function (){ var item = $('#aromaSelector>li>span'); for (var i = 0; i <= item.length; i++) { if ($(item[i]).text() === $(".PlentyArticleCharacters>.PlentyArticleCharacterName").text()) { $(item[i]).addClass('active'); }} for (var i = 0; i <= item.length; i++) { if ($(item[i]).text() === $(".PlentyArticleCharacters>.PlentyArticleCharacterName:nth-child(2)").text()) { $(item[i]).addClass('active'); }} for (var i = 0; i <= item.length; i++) { if ($(item[i]).text() === $(".PlentyArticleCharacters>.PlentyArticleCharacterName:nth-child(3)").text()) { $(item[i]).addClass('active'); }} }); function runAfterElementExists(jquery_selector, callback) {var checker = window.setInterval(function() {if ($(jquery_selector).length) {clearInterval(checker);callback();}}, 200);} var ArtNr = $('.variationID').html(); $('input[name="variationid"]').val('106120'); $(".ItemQuestionForm form > input[data-mail='subject']").val("Artikel-Nummer: " + ArtNr); $('.ItemQuestionForm input[name="Artikelnr."]').attr('disabled', 'disabled').val(ArtNr);