Get the title from the attributes and update it on refresh

Please see #328, this PR is for updating the title based on the `title` attributes of the DOM element.