Answers for "js get object field value by field name"

4

how to get input object in js by name

var element = document.querySelector("form[name='second'] input[name='secondText']");
Posted by: Guest on July-08-2020
0

get object field from variable name javascript

var something = {
  bar: 'foo'
};
var foo = 'bar';

// both x = something[foo] and something[foo] = x work as expected
console.log(something[foo]);
console.log(something.bar)
Posted by: Guest on May-16-2021

Code answers related to "js get object field value by field name"

Code answers related to "Javascript"

Browse Popular Code Answers by Language