在我的 HTML 表单中集成下拉菜单时遇到问题。我已经尝试了我能做的一切以及我在网上找到的东西,但它仍然不起作用。我发现这段代码在 JSFiddle 上运行正常。脚本路径很好,并且脚本已正确加载。
我错过了什么?
<html>
<head>
<meta charset="UTF-8">
<link href="../semantic/packaged/css/semantic.min.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="../semantic/packaged/javascript/semantic.min.js"></script>
<script>
$('.ui.dropdown').dropdown();
</script>
</head>
<body>
<form class="ui form segment" style="width:400px; margin:auto;" method="POST" action="register_do.php">
<div class="field">
<label>학년</label>
<div class="ui fluid dropdown selection">
<input type="hidden" name="grade">
<div class="default text">학년</div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item" data-value="10">고1</div>
<div class="item" data-value="11">고2</div>
<div class="item" data-value="12">고3</div>
</div>
</div>
</div>
<div class="ui buttons">
<button class="ui red submit button">등록</button>
<div class="or"></div>
<div class="ui button" onClick="history.back();">취소</div>
</div>
</form>
</body>
</html>