Q:

jquery show not working in function

Can't figure out the problem here. show() outside of function onSelectChange works good, inside no. Append works good if label is not hidden.
My codes below:

jQuery(document).ready(function(){
 jQuery("#cityfrom").change(onSelectChange);
});
function onSelectChange(){
 var selected = jQuery("#cityfrom option:selected");
 if(selected.val() != 0){
  selectedfrom = selected.text();
  jQuery("#hidden").show();
  jQuery("#append").text(selectedfrom);
 }
}
#hidden{
 display:none;
}
<label id="hidden"><input type="radio" name="start" value="xx"><span id="append"></span></label>
<select id="cityfrom">
 <option value="" disabled selected>Izvēlies citu pilsētu</option>
 <option name="pilseta" value="smiltene">Smiltene</option>
 <option name="pilseta" value="valmiera">Valmiera</option>
</select>

A:

There are 2 funamental problems with the snippet you posted (neither actual problems with your code!)

When you set up your snippet you didnt choose and version of jQuery
You included <script> tags in the javascript pane

jQuery(document).ready(function() {
  jQuery("#cityfrom").change(onSelectChange);

  
});

function onSelectChange() {
    var selected = jQuery("#cityfrom option:selected");
    if (selected.val() != 0) {
      selectedfrom = selected.text();
      jQuery("#hidden").show();
      jQuery("#append").text(selectedfrom);
    }
  }
#hidden {
  display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label id="hidden">
  <input type="radio" name="start" value="xx"><span id="append"></span>
</label>
<select id="cityfrom">
  <option value="" disabled selected>Izvēlies citu pilsētu</option>
  <option name="pilseta" value="smiltene">Smiltene</option>
  <option name="pilseta" value="valmiera">Valmiera</option>
</select>

