adding the functionality for the whole page or for a specific HTML element