<html> <head> <title> get setのテスト </title> </head> <body> <script type="text/javascript"> <!-- function Wow(){ // define property Prop1 getter & setter var _prop1 = ''; this.__defineGetter__('Prop1', function(){ return _prop1; }); this.__defineSetter__('Prop1', function(value){ _prop1 = value; }); this.showProp1 = function(){ alert(this.Prop1); }; }; var wow = new Wow(); wow.Prop1 = 'OH!'; wow.showProp1(); //--> </script> </body> </html>