Yes, I know there's a lot of good answers for this question, however, I can't seem to make/adapt the code to work in my situation. This is a big project I'm working on, to make digital worksheets. I'm trying to make certain panels visible depending on the value of a tag, however all the code I've tried I can't adapt to work with my case as the question template (where it gets submitted is based on the ?q= number) is in a iframe to save time and file size. Would it be possible to do a button to update the visible panels, or do AJAX for it whilst being in a iframe? I don't have any experience in AJAX or jQuery, and yes I've tried to lean them but they in my opinion is too complicated.
I found this answer, but it doesn't work for some reason.
Tip: If your giving me completed code (thank you!) just know that Text, Paragraph, and Mathematical all lead to div type-1
<html>  
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/f.css">
<script src="../assets/fjquery.js"></script>
<script src="../assets/f.js"></script>
<script src="../assets/fm.js"></script>
</head> 
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
    </script>
    <label>Question
    <input type="text" placeholder="e.i Who was the discoverer of evolution?" name="q-name" required>
    </label>
    <div class="large-12 columns">
        <label>Question Type 
        <span style="color: #bbb;"> <i>Click 'Update Field' after selection.</i></span>
        <select id="qtype" name="qtype">
        <option value="2">Multiple Choice</option>
        <option value="3">Radio choice</option>
        <option value="1">Text</option>
        <option value="1">Paragraph</option>
        <option value="4">Selection Dropdown</option>
        <option value="1">Mathmatical</option>
        </select>
        </label>
        <a onClick="updateQTp()">Update Field</a> |
        <a onClick="hide()">Hide All Fields</a> 
        <p id="tester"></p>
    </div>
    <div class="large-12 columns">
    <!--TEXT, PARAGRAPH, MATH--><div id="type-1">
    <div class="panel">
        <label>Answer Type (Text, Paragraph, Mathmatical)</label>
        <input id="radio1" type="radio" name="tpm" value="simple" checked><label for="radio1">Has Simple Answer</label>
        <input id="radio2" type="radio" name="tpm" value="complex"><label for="radio2">Has Complex Answer</label>
        <input id="radio3" type="radio" name="tpm" value="human"><label for="radio3">Needs manual correction</label>
        <hr style="padding: 4; margin: 0;" />
    <label>Correct Answer (Simple Answer Only)
    <input type="text" placeholder="e.i Charles Darwin" name="abox">
    </label>
    </div>
    </div><!--MULTI CHOICE--><div id="type-2">
    <div class="panel">
        <label>Answer Type (Multiple Choice)</label>
        <ol style="list-style-type: square;">
         <li><label><input id="mc-tbox" type="checkbox" name="mc-1"> Correct</label><input id="mc-tbox" type="text" placeholder="A" name="mc-l1" ></li>
         <li><label><input id="mc-tbox" type="checkbox" name="mc-2"> Correct </label><input id="mc-tbox" type="text" placeholder="B" name="mc-l2" ></li>
         <li><label><input id="mc-tbox" type="checkbox" name="mc-3"> Correct </label><input id="mc-tbox" type="text" placeholder="C" name="mc-l3" ></li>
         <li><label><input id="mc-tbox" type="checkbox" name="mc-4"> Correct </label><input id="mc-tbox" type="text" placeholder="D" name="mc-l4" ></li>
        </ol>
    </div>
    </div><!--RADIO CHOICE--><div id="type-3">
    <div class="panel">
        <label>Answer Type (Radio Choice)</label>
        <ol style="list-style-type: circle;">
         <li><input id="rc-tbox" type="text" placeholder="A" name="rc-l1" >     </li>
         <li><input id="rc-tbox" type="text" placeholder="B" name="rc-l2" ></li>
         <li><input id="rc-tbox" type="text" placeholder="C" name="rc-l3" ></li>
         <li><input id="rc-tbox" type="text" placeholder="D" name="rc-l4" ></li>
        </ol>
        <select name="rd-crt">
        <label>Correct letter
        <option value="">A</option>
        <option value="">B</option>
        <option value="">C</option>
        <option value="">D</option>
        </label>
        </select>
    </div>
    </div><!--DROPDOWN--><div id="type-4">
    <div class="panel">
        <label>Answer Type (Dropdown)</label>
        <ol style="list-style-type: circle;">
         <li><input id="rc-tbox" type="text" placeholder="A" name="rc-l1" ></li>
         <li><input id="rc-tbox" type="text" placeholder="B" name="rc-l2" ></li>
         <li><input id="rc-tbox" type="text" placeholder="C" name="rc-l3" ></li>
         <li><input id="rc-tbox" type="text" placeholder="D" name="rc-l4" ></li>
        </ol>
        <select name="sd-crt">
        <label>Correct letter
        <option value="">A</option>
        <option value="">B</option>
        <option value="">C</option>
        <option value="">D</option>
        </label>
        </select>
    </div>
    </div>
    </div>
    <div class="large-10 columns">
    <label>Help Text
    <input type="text" placeholder="e.i Enter a name" name="qhelp">
    </label>
    </div>
    <div class="small-5 columns">
    <label>
    <input id="useht" type="checkbox" name="useht" value="use" required checked>
    Use Help Text</label>
    <label>
    <input type="checkbox" id="showwork" name="showwork"> 'Show Work' Textarea
    </label>
    </div>
    <div class="large-12 columns">  
    <label>Public Comments<textarea cols="20" rows="2" name="pcomm"></textarea></label>
    <label>Private Comments<textarea cols="20" rows="2" name="pcommprv"></textarea></label>
    </div>
    <script>
    document.getElementById("type-1").hide();
    document.getElementById("type-2").hide();
    document.getElementById("type-3").hide();
    document.getElementById("type-4").hide();
    $('#qtype').change(function() {
    $('.my-div-class:visible').hide();
    $('#type-' + $('#qtype').val()).show();
    });
    </script>
    </html>
 
    