javascript - Selected achor tag value on hover -


i want value of anchor tag when mouse hover , values come autocompleted function .i have added code not give me value of anchor tag.so how value of anchor tags on mouse hover please me thank advance

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> <script type="text/javascript">         $(document).ready(function () {             searchtext();          });          function searchtext() {             $("#txtsearch").autocomplete({                 source: function (request, response) {                     $.ajax({                         type: "post",                         contenttype: "application/json; charset=utf-8",                         url: "test.aspx/getautocompletedata",                         data: "{'username':'" + extractlast(request.term) + "'}",                         datatype: "json",                         success: function (data) {                             response(data.d);                             $(".ui-autocomplete").addclass("test1");                         },                         error: function (result) {                             alert("error");                         }                     });                 },                 focus: function () {                     // prevent value inserted on focus                     return false;                 },                 select: function (event, ui) {                     var terms = split(this.value);                     // remove current input                     terms.pop();                     // add selected item                     terms.push(ui.item.value);                     // add placeholder comma-and-space @ end                     terms.push("");                     this.value = terms.join(", ");                     return false;                 }             });             $("#txtsearch").bind("keydown", function (event) {                 if (event.keycode === $.ui.keycode.tab &&                 $(this).data("autocomplete").menu.active) {                     event.preventdefault();                 }             })               $(function () {                 $(".ui-autocomplete li").hover(function () {                     var txt = $(this).find('a').html(); // .text(); text in anchors                     alert(txt);                 });             });               function split(val) {                 return val.split(/,\s*/);             }             function extractlast(term) {                 return split(term).pop();             }    $(function () {                 $(".ui-autocomplete li").hover(function () {                     var txt = $(this).find('a').html(); // .text(); text in anchors                     alert(txt);                 });             });          }     </script>                                    html  <ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all test1" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 1;                     top: -16px; left: 115px; display: none; position: relative; width: 1310px;">     <li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">city                         name</a></li>     <li class="ui-menu-item" role="menuitem">         <a class="ui-corner-all" tabindex="-1">             <br>         </a>     </li>     <li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">agra</a></li>     <li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">ahmedabad</a></li>     <li class="ui-menu-item" role="menuitem">         <a class="ui-corner-all" tabindex="-1">             <br>         </a>     </li>     <li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">location                         name</a></li>     <li class="ui-menu-item" role="menuitem">         <a class="ui-corner-all" tabindex="-1">             <br>         </a>     </li> </ul> 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -