The example in this article describes the implementation method of selecting trigger events based on the jquery Select dropdown box. Share to everyone for your reference, specific as follows:
I have always believed that the Select dropdown box selects options with the OnClick registration event, as follows:
<select>
<option value= "0" onclick= "func (0)" > option one </option>
<option value= "1" onclick= " Func (1) "> option two </option>
</select>
Today, there is a request to do linkage menu, is every point, adjacent to the Drop-down box will automatically change, I think no problem ah, the onclick walk
So we went up the line and the client said, IE8 must support, I think also, XP's IE kernel can only rise to IE8, now many users are still reluctant to XP, but it supports the onclick ah, I have tried under the FF, a little problem, but a switch IE8 under, tell you, a little reaction did not.
Then the multi-party search for information, the original select its event is registered on its own label, not onclick, but onchange, child tags on the lower version of the browser is not valid, but also not the formal standard.
<select onchange= "func () >
<option value=" 0 "> Options one </option>
<option value=" 1 "> Option two </option>
</select>
Well, here's the question again, what about the parameters I passed? How to receive Parameters
It's not a problem, jquery gives you the answer.
function func () {
//Get the selected option tag
var vs = $ (' Select Option:selected '). Val ();
Of course, the select here is best to add a ID to confuse, OK, problem solving, rose posture of wood there, haha ...
More about jquery-related content readers can view the site topics: "jquery form (form) Operation Tips Summary", "jquery Window Operation skills Summary", "jquery drag-and-drop effect and Skills summary", "jquery common Plug-ins and Usage summary", " Ajax Usage Summary in jquery, jquery table (table) Operation tips Summary, jquery extension tips, jquery Common classic effects summary, jquery animation and special effects usage summary and jquery selector Usage Summary
I hope this article will help you with the jquery program design.