So I am using jquery.autocomplete.js,
demo can be found here http://www.ajaxdaddy.com/demo-jquery-autocomplete.html
I want to be able to return a span value in an alert message.
this is the php file that echos results:
$email="span id='emaild'".$rs['email'].'/span'; $str.= $email." ".$rs['phone']." ".$rs['address1']." ".$rs['address2']." "."\n"; echo $str;
email is inside a span tag. when I click on that result I want to be able to see an alert of that value, that is the email.
This is what I have so far, it displays a 0 zero on the alert box as a result
.click(function(event) {
var keyw = jQuery("li").val();
alert(keyw);
$(target(event)).addClass(CLASSES.ACTIVE);
select();
// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
input.focus();
return false;
})
You need the
textmethod instead ofval:The
valmethod is used to return the value of thevalueproperty, and the only elements that havevalueproperties are those which are used in forms, such asinputorselect.