The is a demo of ArcGIS JavaScript API. This sample shows how you can use a draw toolbar to sketch many kinds of geometries on the map.

Draw :