It's bad juju to do something to someone's page just by including your script. They should have to write this code on their page if they want their headings to be automatically numbered. Your job as the library author is to give them the tools, document it and provide an API with good defaults. A sign of a well-written library is the ability for the user to do something the author hadn't considered.