上代码:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>無題のページ</title>

<script src="script/jquery-1.9.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(function() {
$("select").each(function(i, n) {
var options = "";
$(n).find("option").each(function(j, m) {
if (options.indexOf($(m)[0].outerHTML) == -1) {
options += $(m)[0].outerHTML;
}
});
$(n).html(options);
});
})
</script>

</head>
<body>
<select>
<option>1 </option>
<option>1 </option>
<option>2 </option>
<option>2 </option>
<option>3</option>
</select>
</body>
</html>

相关文章:

  • 2022-02-17
  • 2021-12-12
  • 2021-10-19
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-05-19
  • 2021-12-31
相关资源
相似解决方案