JavaScript Hide Div when option from select chosen hide when minimized option,hide option in select jquery,hide

I have a div that I need to hide when an option is selected in an option, below is my current html:

Type:<select name="Type" id="Type">
        <option value="choice">Multiple choice</option>
        <option value="image">Image/Video</option>
        <option value="click">Click Image</option>
     </select><br>
<div id="answers">  
    Correct Answer:<input type="text" name="answer"><br>        
    Wrong Answer 1:<input type="text" name="wrong1"><br>
    Wrong Answer 2:<input type="text" name="wrong2"><br>
    Wrong Answer 3:<input type="text" name="wrong3"><br>
</div>

So what I need is when the option with the value "click" is selected the div with the id "answers" is hidden, if either the other options are selected this div should be shown.

I am sure this can be dome with javas

Answer:1

Listen for the change event on select, take the value .val() and check if it's "click". If so, show() the #answers, otherwise hide() them.

var $answers = $("#answers");
$("#Type").on("change", function() {
  if ($(this).val() === "click") {
    $answers.show();
  } else {
    $answers.hide();
  }
});
#answers {
  display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Type:
<select name="Type" id="Type">
  <option value="choice">Multiple choice</option>
  <option value="image">Image/Video</option>
  <option value="click">Click Image</option>
</select>
<br>
<div id="answers">
  Correct Answer:
  <input type="text" name="answer">
  <br>Wrong Answer 1:
  <input type="text" name="wrong1">
  <br>Wrong Answer 2:
  <input type="text" name="wrong2">
  <br>Wrong Answer 3:
  <input type="text" name="wrong3">
  <br>
</div>
Answer:2

So I want to swap two div elements that have a CKEditor inside. I viewed some of the previous questions and tried to do it that way. It's all OK, the elements are swapped. But one of the elements ...

So I want to swap two div elements that have a CKEditor inside. I viewed some of the previous questions and tried to do it that way. It's all OK, the elements are swapped. But one of the elements ...

  1. swap elements js
  2. swap array elements javascript
  3. swap html elements javascript
  4. swap dom elements javascript
  5. swap two elements javascript
  6. swap array elements javascript es6
  7. swap two array elements javascript
  8. swap elements in list javascript

Cache all requests from an app without explicitly specifying urlsToCache. So I will cache stuff under fetch event. To respond to requests from the cache. Update the cache when fetch is success. ...

Cache all requests from an app without explicitly specifying urlsToCache. So I will cache stuff under fetch event. To respond to requests from the cache. Update the cache when fetch is success. ...

  1. when should you write a functional (skills) résumé
  2. when should you write out numbers
  3. when should child write name
  4. when should i write my birth plan
  5. when should you write numbers as words
  6. when should child write their name
  7. when should you write the executive summary
  8. when should you write a business plan
  9. when should you write a cover letter
  10. when should you write the introduction and overview portion
  11. when should i write out numbers
  12. when should you write without prejudice on a letter
  13. when should you write a draft of your summary
  14. when should i write gre for fall 2020
  15. when should i write my college essay
  16. when should i write a cover letter
  17. when should i write numbers as words
  18. when should we write gate exam

I am C++ programmer and new to JS. I am trying to filter table based on click event. I have following table. How can i keep records based on clicking keys and filtering other records. <!DOCTYPE ...

I am C++ programmer and new to JS. I am trying to filter table based on click event. I have following table. How can i keep records based on clicking keys and filtering other records. <!DOCTYPE ...

  1. filter records based on a combo box selection
  2. access filter records based combobox selection
  3. filter form records based on combobox
  4. crystal reports filter records based on parameter
  5. how to filter records based on date in sql
  6. how to filter records based on date in oracle
  7. filter records in subform based on a combo box
  8. filter records from a datatable based on a condition

I want to get part of a path in URL via Angular.js and i found solution: http://mywebsite.com/one/HEREiWANT/three first i do this: app.config(function($locationProvider){ $locationProvider....

I want to get part of a path in URL via Angular.js and i found solution: http://mywebsite.com/one/HEREiWANT/three first i do this: app.config(function($locationProvider){ $locationProvider....