

<script>
mybutton = {
aInternal: 10,
aListener: function(val) {},
set text(val) {
this.aInternal = val;
this.aListener(val);
$('#mybutton').html(val);
},
get text() {
return this.aInternal;
},
registerListener: function(listener) {
this.aListener = listener;
}
}

//TextChanged
mybutton.registerListener(function(val) {
//alert(JSON.stringify(this));
});

function myButton_onclick () {
alert('hello');
};

var myButton = {
onclick: function(){

if (mybutton.text == 'Hello World') {mybutton.text = 'Goodbye World'}else{mybutton.text = 'Hello World';
}
}


};

</script>

<ons-page>

	<ons-button onclick="myButton['onclick']();alert(event.type);" id="mybutton">Default</ons-button>

</ons-page>
