| Ylbtech-javascript-util:util.select.js |
Filter Tools
| 1.b,js-source code back to top |
1.b.1, M.yintai
/*Get the selected name*/functionGetselectedtext (ControlID) {varSelectedText =NULL; $("#" + ControlID + "option"). each (function () { if($( This). attr ("Selected") ) {SelectedText= $( This). text (); return false; } }); returnSelectedText;}/*Select items based on text*/functionSelectbytext (ControlID, text) {$ ("#" + ControlID + "option"). each (function () { varCurrenttext = $ ( This). text (); if(Currenttext = =text) { $( This). attr ("Selected",true); return false; } });}/*Select items based on text*/functionSelectbyvalue (ControlID, value) {$ ("#" + ControlID + "option"). each (function () { varCurrentValue = $ ( This). attr ("value"); if(CurrentValue = =value) { $( This). attr ("Selected",true); return false; } });}/*get values based on text*/functionGetvaluebytext (ControlID, text) {varValue =NULL; $("#" + ControlID + "option"). each (function () { varCurrenttext = $ ( This). text (); if(Currenttext = =text) {Value= $( This). attr ("value"); return false; } }); returnvalue;}View Code
1.b.2,
| 1.C,js-relevent References (related references) back to top |
|
Ylbtech Source: http://ylbtech.cnblogs.com/ This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility. |