Right now I have a script that auto suggests some post titles, using wordpress’ suggest.js
<script type="text/javascript">
var se_ajax_url = '<?php echo admin_url('admin-ajax.php'); ?>';
jQuery(document).ready(function() {
jQuery('#love-input').suggest(se_ajax_url + '?action=se_lookup', {
onSelect: function() {
thevalue = this.value;
thevalue = thevalue.split(' (');
jQuery('#love-input').val(thevalue[0]);
}
});
});
However, it appends the list to the bottom of my body tag, and I can’t figure out how to put it in the specific div that I want. Help!
You should care about tag input classes and CSS. All casses can be set in JS function:
So, this will add wpx_ac_results class to the result list . And this CSS should fix it:
The tag input looks like this: