Smoke alarms are so important and really can save lives. Having battery powered smoke alarms can be dangerous if you do not remember to change them or simply remove he battery when it starts to bee to say it is low.
You can have smoke alarms that are linked up to the mains allowing them to run constantly off your electricity supply. This means that you do not have to worry about replacing batteries. Often they will have a battery inside to keep them operative should the power go off, but as this is not often needed, the battery will last for years before needing to be replaced.
These smoke alarms can also often be designed so that they do not sound when you burn your toast for example but would if there was a fire.
Mains powered smoke alarms do not cost a lot more than battery powered ones but you can easily make the difference back in the money you save from buying batteries.