Sonia,
When you want a var available in any function in the widget you define it this way:
return declare([BaseWidget, _WidgetsInTemplateMixin], {
// DemoWidget code goes here
baseClass: 'jimu-widget-demo',
zipcodes1: null,
startup: function() {
this.inherited(arguments);
console.log('startup');
//var zipcodes1;
},
_onchgclearfeatures: function() {
alert("clear");
this.zipcodes1.clearSelection();
},