Get and set attributes and emit events