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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -