How do I change the properties of an element dynamically?

I would like to know how to dynamically change an element property to an item related to another property.
For example, “excel-like handsontable”, if I set a table to the Type of content property, the table item will dynamically appear at the bottom.
Is it possible to do the same thing as this?