Custom Widget replacing dom element it is bound to

Custom Widget replacing dom element it is bound to

Hi, I am wanting to create custom widget which replaces the dom element the widget is bound with another dom element. 

Is there is a standard way to do this? 

Should I do this? 


Cheers.