How do I dynamically assign properties to an object in TypeScript? If a law is new but its interpretation is vague, can the courts directly ask the drafters the intent and official interpretation of their law? The following example uses the load event handler to determine if an image, which exists in the DOM tree, has been completely loaded: You can assign an onload event handler directly using the onload attribute of the element, like this: If you create an image element dynamically, you can assign an onload event handler before setting the src property as follows: The