Home > Back-end >  Before the search to keep the options of how to write?
Before the search to keep the options of how to write?

Time:11-29




When I choose BBB option - search into the BBB/search. HTML page will be will return to AAA state of options, when joining the cookie switch to CCC/search. The HTML page and return to the original AAA state.
Great god help the novice ~


The code is as follows...


  • BBB

  • CCC
















<script>
$(function () {
$(". Select_box "). Click (function (event) {
Event. StopPropagation ();
$(this). The find (" option "). Toggle ();
$(this). The parent (s). The siblings (.), find (" option "). Hide ();
});
The $(document). Click (function (event) {
Var eo=$(event. Target);
If ($(". Select_box ") is (" : the visible ") & amp; & Eo. Attr (" class ")!="option" & amp; & ! Eo. The parent (" option "). The length)
$(' option '). Hide ();
});
$(" option li "). Click (function () {
Var check_value=https://bbs.csdn.net/topics/$(this). The text ();
Var zlValue=https://bbs.csdn.net/topics/$(' option li: eq (1) '). The HTML ();
Var bqValue=https://bbs.csdn.net/topics/$(' option li: eq. (2) '). The HTML ();
Var mxValue=https://bbs.csdn.net/topics/$(' option li: eq (3) '). The HTML ();
$(this). The parent (s). The siblings (". Select_txt "). The text (check_value);
$(" # select_value "). Val (check_value);
If (check_value="AAA" https://bbs.csdn.net/topics/={
$(' # search input '). Prop (' placeholder ', 'please enter to search AAA);
$(' # search '). Prop (' action ', '{url (' AAA/search')} ");
} else if (check_value "BBB" https://bbs.csdn.net/topics/=={
$(' # search input '). Prop (' placeholder ', 'please enter BBB to search');
$(' # search '). Prop (' action ', '{url (' BBB/search')} ");
} else if (check_value="CCC" https://bbs.csdn.net/topics/={
$(' # search input '). Prop (' placeholder ', 'please enter to search CCC);
$(' # search '). Prop (' action ', '{url (' CCC/search')} ");
}
});
})

</script>

CodePudding user response:

CodePudding user response:

Only by string matching to write
  • Related