Native javascript observer