Adding Scroll to Div Function With UI Auto Complete

Adding Scroll to Div Function With UI Auto Complete

Can you please take a look at This Demo  and let me know how I can enable scroll to div of selected item from auto complete?

  1. $(document).ready(function () {
  2.     $('#tags').on('change', function () {
  3.         $('#tagsname').html('You selected: ' + this.value);
  4.         $('html,body').animate({
  5.                scrollTop: $("#"+ this.value).offset().top
  6.          });
  7.     }).change();
  8.     $('#tags').on('autocompleteselect', function (e, ui) {
  9.         $('#tagsname').html('You selected: ' + ui.item.value);
  10.     });
  11. });
but I am getting this error 


Uncaught TypeError: Cannot read property 'top' of undefined