javascript - Execute change method on select hidden -
I have a list (menu) with value ?????? When a user clicks to execute the click function that hides the value of a selector it works fine, but does not display the information to display the correct option by selecting itself.
& lt; Ul & gt; & Lt; Li class = 'active-sub' & gt; & Lt; A href = '#' & gt; & Lt; Span & gt; SELECCIONE & lt; / Span & gt; & Lt; / A & gt; & Lt; Ul & gt; & Lt; Li class = 'is-sub' & gt; & Lt; An id = "S0001" href = '#' & gt; & Lt; Span & gt; Auto Nouveau & lt; / Span & gt; & Lt; / A & gt; & Lt; / li & gt; & Lt; Li class = 'is-sub' & gt; & Lt; An ID = "S0002" href = '#' & gt; & Lt; Span & gt; Product 2 & lt; / Span & gt; & Lt; / A & gt; & Lt; / li & gt; & Lt; / Ul & gt;
& lt; Script & gt; $ ("# S0001") click (function () {$ ("# proyecto"). Val ('S0001'); $ ("# proyecto"). Change.val ();}); & Lt; / Script & gt; The selection of all these functionality is hidden
& Lt; Option value = '0001' & gt; Auto Nouveau & lt; / Options & gt; & Lt; Option value = 'S0002' & gt; CELEBRACIONES & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt; To work it correctly, once I change the value of the selection, the change event must be run and the correct information should be charged.
You need to call the change event: $ ("# proyecto"). () Note: This will run the defined change handler, not native functionality
Comments
Post a Comment