arrays - Reference a value in JavaScript -


i have couple of check boxes i'd use "name" attribute value reference within array.

let's have array so:

var test = {     "one" : 1,     "two" : 2, }  var somebtn = "one"; 

how can following?

test.somebtn; // translate test.one 

obviously, test.somebtn not work. possible?

just refer if array:

test[somebtn] 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -