Append Url value to select dropdown menu using jquery -


i using textbox attached dropdown menu. textbox searching person name , dropdown list comes different categories.

i used send search value , dropdown list selected value url , getting results, after displaying results dropdown menu value changing. getting url, cannot append select dropdown menu.

here in url getting value of dropdown need append dropdown list text.

<select id="menu">        <option value = "all"> </option>      <option value = "people"> people </option>      <option value = "conversations"> conversations </option>      <option value = "products"> products </option>      <option value = "circles"> circles </option> </select>  $(document).ready(function () {     var pathname = window.location.href;     var urlval = pathname.substr(pathname.indexof('='));     var url = urlval.split('=');     var url2 = url[1].split('&'); }); 

when result comes depend on have select option forcefully like

$('#menu option:contains(' + resultoption + ')"').attr('selected', 'selected'); 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -