Our current code allows two types for the container property, one is a DOM node that will be used as is, the other is a string that represents an id for the node to use.
We could improve this further by allowing the user to pass any selector allowed by querySelector.
If we detect that the value given is not a node and includes a special character, we will use querySelector, if there is no special char, we fallback to getElementById
Our current code allows two types for the container property, one is a DOM node that will be used as is, the other is a string that represents an id for the node to use.
We could improve this further by allowing the user to pass any selector allowed by querySelector.
If we detect that the value given is not a node and includes a special character, we will use querySelector, if there is no special char, we fallback to getElementById