Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/474.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery$。下拉列表选项的数据顺序不正确_Javascript_Jquery_Drop Down Menu - Fatal编程技术网

Javascript jQuery$。下拉列表选项的数据顺序不正确

Javascript jQuery$。下拉列表选项的数据顺序不正确,javascript,jquery,drop-down-menu,Javascript,Jquery,Drop Down Menu,我有下面的HTML <table id="_GroupsTable"> <thead> <tr> <th style="width: 90%;"> City </th> <th style="width: 10%;"> Del </th> </tr> </thead> <tbody>

我有下面的HTML

<table id="_GroupsTable">
<thead>
   <tr>
      <th style="width: 90%;">
         City
      </th>
      <th style="width: 10%;">
         Del
      </th>
   </tr>
</thead>
<tbody>
   <tr>
      <td>
         <select id="_SkillsDropDownList0" name="_SkillsDropDownList0">
            <option value="1">All Skills</option>
            <option value="2">&nbsp;Web App</option>
            <option selected="selected" value="5">&nbsp;&nbsp;MVC</option>
            <option value="3">&nbsp;&nbsp;jQuery</option>
            <option value="16">&nbsp;&nbsp;HTML</option>
            <option value="4">&nbsp;&nbsp;CSS</option>
         </select>
      </td>
      <td style="text-align: center;">
         <input id="_GroupsRolesCheckbox0" type="checkbox">
      </td>
   </tr>
</tbody>
<table>

我希望1=所有技能,2=Web应用程序,3=jQuery中的值。。在下拉列表中,值的显示顺序基本相同,但是,我得到的顺序不同。任何指向正确方向的指针都将受到欢迎。

首先是什么填充了
$.data()
?它不是由jQuery自动填充的。为什么要使用
$.data()
而不是
$(“#u GroupsTable”)。数据(“groupsKvp”)
?使用$(“#u GroupsTable”)。数据(“groupsKvp”)没有改变结果( :(
var jdata = $("#_GroupsTable")[0];
var kvpGroups = $.data(jdata, "groupsKvp");