Use Javascript variable in object name? [duplicate]
问题 This question already has answers here : Dynamically access object property using variable (13 answers) Closed 5 years ago . I am using CKEditor, and, when referring to the CKEditor instance, I need to use a variable. But, since calling the instance is a object, I am really not sure how to do this. I am using: CKEDITOR.instances.textarea123.insertHtml('<p>Whatever</p>'); The issue is, I need 123 to be a variable, because I need to change the instance based on the editor page that is loaded.