javascript - Reset select field on select with select2 -


I'm trying to reset a selected area like this

  $ ( '# Name') .change (function () {$ ('# name2'). Val ($ ('# name2') .prop ('default selected')););   

But it does not work on select2.

Here's a way I want to see and work like this!

and it should be new ..

add default selected Dropdown to set the default selected value of the attribute in second dropdown, this will allow the $ ('# name2') to redirect prop ('default select') default of the dropdown The value, which will reset the second dropdown on the changes in the first dropdown.

  & lt; Select ID = "Name 2" Choose Default = "" & gt; & Lt; Option value = "" & gt; Select all & lt; / Options & gt; & Lt; Option value = "1" & gt; Lesson 1 & lt; / Options & gt; & Lt; Option value = "2" & gt; Lesson 2 & lt; / Options & gt; & Lt; Option value = "3" & gt; Lesson 3 & lt; / Options & gt; & Lt; / Select & gt;    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -