I have a
form DOM element:
var virDom = document.getElementsByTagName("form");
virDom has two fields with IDs
pwdId... I can access
virDom.creditId without any issue but,
virDom.pwdId.. is failing with a syntax error, because of the periods contained in the name.
How can I access such properties?
Use bracket notation:
This applies to any object, and it is particularly useful for non-identifier-safe characters and also for accessing keys that you may not know ahead of time.
©2020 All rights reserved.