2

I know I must missed something because none of the example of works in my computer.

Take the simplest first example at the website.

I copied the code AS IS and it doesn't work at all for me. I included the semantic.min.css and semantic.min.js also just in case I included the jQuery using google CDN.

Following is my html code.

<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" type="text/css" href="semantic/dist/semantic.min.css">
<script src="semantic/dist/semantic.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>

</head>
<body>


<script>
$('.ui.dropdown')
  .dropdown()
;
</script>



<div class="ui dropdown">
  <input type="hidden" name="gender">
  <i class="dropdown icon"></i>
  <div class="default text">Gender</div>
  <div class="menu">
    <div class="item" data-value="male">Male</div>
    <div class="item" data-value="female">Female</div>
  </div>
</div>



</body>
</html>

The output is like this.. enter image description here

Thank you! I am pretty new to JavaScript and semantic UI.

2 Answers 2

2

i use this order of linking js files and work fine

    <!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
  <script type="text/javascript" src="../bower_components/jquery/dist/jquery.min.js"></script>
  <link rel="stylesheet" type="text/css" href="../bower_components/semantic/dist/semantic.min.css">
  <script src="../bower_components/semantic/dist/semantic.min.js"></script>
</head>
<body>


<select name="gender" class="ui dropdown" id="select">
  <option value="">Gender</option>
  <option value="male">Male</option>
  <option value="female">Female</option>
</select>


<script type="text/javascript">
  $('#select')
    .dropdown()
  ;
</script>
</body>
</html>
Sign up to request clarification or add additional context in comments.

1 Comment

I have been having this problem as well, and this fixed it for me.
0

I need to include jQuery before including .js and .css

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.