Good day. Trying to perform such a moment. I need to write in the array the value of value and name at INPUT. The design should be like this.
var mas = ("black" => "Black", "brown" => "Brown", "white" => "White").
Here is a div with input.
<div class="bl_choiceOfColor"> <input class="active" type="submit" value="Черный" name="black" status="opend"> <input type="submit" value="Бурый" name="brown" status="closed"> <input type="submit" value="Белый" name="white" status="closed"> <div class="clear"></div> </div>
Here is the script that I am writing.
var COLOR_prod = []; $(".bl_choiceOfColor input").each(function(i){ var that = $(this); if(that.hasClass("active")){ COLOR_prod[i] = that.attr("name"); } });
Values are written only as to write values /