javascript version of the widget