javascript - how to get the value of an option in select menu onChange using jquery? -


I am trying to apply the clone selection menu using the following plugins:

< / P>

But I am unable to get the option value of the selection menu, instead it gives the option text.

How to get the value of an option (but not text) in the onChange in the following selection menu by using the jquery call function?

  & lt; Script type = "text / javascript" & gt; JQuery (document) .ready (function ($) {$ ("selection"). ScrollectBox ({predetermined: 'dropdown', numVisibleOptions: 4, scrollInterval: 150, scrollOn: 'hover'});});   

  and choose; Onchange = "function (this);" Id = "selector" category = "selection" & gt; & Lt; Option value = "" selected = "select topic" & gt; Select topic & lt; / Option & gt; & Lt; Option value = "food" & gt; Food & lt; / Options & gt; & Lt; Option value = "P" & gt; Drink & lt; / Options & gt; & Lt; / Select & gt;   

Thanks,


Edit again:

No work < / Strong>

  & lt; Script type = "text / javascript" & gt; JQuery (document) .ready (function ($) {var selectEvent = function ($ el) {someFunction ($ (this) .val ()); return false;} $ ("selection"). ScrollectBox ({preset: 'Dropdown', numVisibleOptions: 4, onsite widget: selectionIight, scrollinterval: 150, scroll down: 'hover'});}); & Lt; / Script & gt;   

This [commodity object]

does not work

  & lt; Script type = "text / javascript" & gt; ScrolllectBox ({predetermined: 'dropdown', numVisibleOptions: 4, scrollInterval: 150, scrollOn: 'hover', onsite event: function (items, Event) {alert (object) .val ();}})}}; & Lt; / Script & gt;   

It returns [commodity object]

According to the source code for

, you should use the onSelectEvent property, such as:

  jQuery (document) .ready (function ($) { ScrolllectBox ({Preset: 'dropdown', numVisibleOptions: 4, scrollInterval: 150, scrollOn: 'hover', controlled: function (item, event) {warning (item.val ())} }}};});    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -