我有一段html代码,其中有一个下拉菜单,它的所有值都来自于读取数据库( Django)上的列。下拉菜单有几个冗余,我想删除这些重复的选项。Here's the html code part that reads from the database: And here's the script that should eliminate the
我有一个下拉菜单,其创建方式如下: {% for host in hosts %}<option value="0.0.0.0" selected>0.0.0.0</option>
但是,由于我正在用循环填充这个下拉菜单,所以我不知道如何确保选择我想要的选项。我确信有一种非常直接的方法可以做到这一点,但我仍然对<