need help in jquery syntax
I need some help in jquery. I am using autocomplete plugin, I want to send the id of the box as the parameter in js code but not sure the syntax please help me out:
function suggestName(id)
{
//this some help here.....
$('#'+id).autocomplete("dealer_live.php",{
width: 150,
selectFirst: true
});
}
$(document).ready(function(){
alert("");
suggestName();
});
</script>
</head>
<body>
<form>
<div>
开发者_高级运维 <input type="text" id="inputName" onKeyUp="suggestName('inputName')" />
</div>
</form>
</body>
suggestName('inputName');
?
You also don't need onKeyUp handler: plugin will take care of it.
精彩评论