Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If i understand ur question correctly, u want to show list which match multiple word of same sentence.</p> <p>Click <a href="http://jsfiddle.net/lakshmanakumar/fjHKN/1/" rel="nofollow">here</a> for example </p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;title&gt;Testing&lt;/title&gt; &lt;link href="css/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" /&gt; &lt;style type="text/css"&gt; .srchHilite { background: yellow; } &lt;/style&gt; &lt;script src="scripts/jquery-1.9.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="scripts/jquery-ui-1.10.3.custom.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { NewAuto(); }); function NewAuto() { var availableTags = ["win the day", "win the heart of", "win the heart of someone"]; alert(availableTags); // alert = win the day,win the heart of,win the heart of someone $("#tags").autocomplete({ source: function(requestObj, responseFunc) { var matchArry = availableTags.slice(); // Copy the array var srchTerms = $.trim(requestObj.term).split(/\s+/); // For each search term, remove non-matches. $.each(srchTerms, function(J, term) { var regX = new RegExp(term, "i"); matchArry = $.map(matchArry, function(item) { return regX.test(item) ? item : null; }); }); // Return the match results. responseFunc(matchArry); }, open: function(event, ui) { // This function provides no hooks to the results list, so we have to trust the selector, for now. var resultsList = $("ul.ui-autocomplete &gt; li.ui-menu-item &gt; a"); var srchTerm = $.trim($("#tags").val()).split(/\s+/).join('|'); // Loop through the results list and highlight the terms. resultsList.each(function() { var jThis = $(this); var regX = new RegExp('(' + srchTerm + ')', "ig"); var oldTxt = jThis.text(); jThis.html(oldTxt.replace(regX, '&lt;span class="srchHilite"&gt;$1&lt;/span&gt;')); }); } }); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;label for="tags"&gt; Multi-word search: &lt;/label&gt; &lt;input type="text" id="tags" /&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload