javascript - Get values from multiple arrays -
i've got hex colours in array.
$.each(["#ff0000", "#000", "#ff6600", "#00e641"], function(i, c) { $('<input class="btns" type="button">') .css("background-color", color) .on("touch", $.proxy(funcnew, null, color)) .appendto("#subdv"); });
i want pass colour mood along hex value. how do it?
["red", "black", "orange", "soft shade"]
e.g.: when #ff0000
selected want able pass word red
. when #ff6600
selected want able pass word orange
.
you do:
var ma = [["#ff0000", 'red'], ["#000", 'black'], ["#ff6600", 'orange'], ["#00e641", 'soft shade']]; $.each(ma, function(a, b){ b[0]; //hex b[1]; //color name });
Comments
Post a Comment