I put this together and seem to work instead of the js that's there
$('._select_color_drop li').click(function(){
var colourText = $(this).find('span').attr('_text_display');
var colourClass = $(this).find('span').attr('class');
$('button._select_color span.color').each(function(){
var currentColourClass = $(this).attr('class');
$(this).removeClass(currentColourClass);
$(this).addClass(colourClass);
$(this).attr('_text_display', colourText);
});
$("button._select_color").each(function(){
var buttonHTML = $("button._select_color").html();
var buttonHTML = buttonHTML.replace(buttonHTML, colourText);
console.log('newHTML: ' + buttonHTML);
$("button._select_color").contents().filter(function () {
return this.nodeType === 3;
}).remove();
$("button._select_color").prepend(colourText);
});
});
Dij MacDermott () - 7 years ago - Reply 0