Change background color with data tag

function changeColor(i){ // Get the data from colorset from the element provided in 'i' var e = $("#" + i).attr("colorset"); // Set the color of the element $("#" + i).css({ backgroundColor: e }); }
Change the background color of an element through the use of a data tag

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.