Use []
notation for string representations of properties:
console.log(obj[name]);
Otherwise it’s looking for the “name” property, rather than the “a” property.
More Related Contents:
- How to launch html using Chrome at “–allow-file-access-from-files” mode?
- Check if user is using IE
- How to scroll an HTML page to a given anchor
- Clicking a button within a form causes page refresh
- Firebase Permission Denied
- Show datalist labels but submit the actual value
- Pass a string parameter in an onclick function
- Using JQuery hover with HTML image map
- is it evil to use eval to convert a string to a function? [closed]
- appending array to FormData and send via AJAX
- Can I use javascript to dynamically change a video’s source?
- how to set socket.io origins to restrict connections to one url
- Loading external javascript in google chrome extension
- How do you clear the focus in javascript?
- What’s the difference/incompatibility between ng-model and ng-value?
- HTML 5 – Play file at certain time point
- How to Convert any of the 5 Islamic (Hijri) Calendars’ Dates to any of 18 World Calendars without External Libraries or Complex Astronomical Formulas
- On click get button Value
- When is null or undefined used in JavaScript? [duplicate]
- In ReactJS, why does `setState` behave differently when called synchronously?
- What is the benefit of prepending async to a function that returns a promise?
- Remove whitespaces inside a string in javascript
- How can I get an element from within a frameset frame using JavaScript?
- Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)
- Sort a dictionary by value in JavaScript
- JSON Parse File Path
- Upgrading to Angular 10 – Fix CommonJS or AMD dependencies can cause optimization bailouts
- why module pattern?
- Unchecked runtime.lastError: Cannot access contents of url “”. Extension manifest must request permission to access this host. In manifest 3
- How can I calculate the difference between two times that are in 24 hour format?