Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select id=one class="ui dropdown">
- <option value="a">A</option>
- <option value="b">B</option>
- <option value="c">C</option>
- </select>
- <select id=two>
- <option value="x">X</option>
- <option value="y">Y</option>
- <option value="z">Z</option>
- </select>
- $('.ui.dropdown').dropdown();
- //I have templated lists that get swapped in and out
- var one = document.getElementById("one");
- var two = document.getElementById("two");
- one.innerHTML = two.innerHTML;
- $('.ui.dropdown').dropdown('refresh');
- $('.ui.dropdown').dropdown('set selected', 'x'); //this doesn't work
- setTimeout(function () {
- $(id).dropdown('set selected', value);
- }, 1);
- $(id).dropdown('set value', value)
- setTimeout(function () {
- $(id).dropdown('set selected', value);
- }, 1);
Add Comment
Please, Sign In to add comment