Added DOM event listener before adding the details
Merge pull request #1 from dirkgroenen/patch-1

Added DOM event listener before adding the details