获取选择框的值onchange [关闭]

                <div class="grid--cell fl1 lh-lg">
                    <div class="grid--cell fl1 lh-lg">
                        It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and   cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened,   <a href="/help/reopen-questions">visit the help center</a>.

                    </div>
                </div>
            </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2013-05-18 14:23:56Z" class="relativetime">6 years ago</span>.</div>
        </div>
    </aside>

The following script gives me the result of select box onchange. But along with value whole page again reloading. I have tried many things but of no use.

My code,

<script>
    $(function(){
      $("select[name='cname']").change(function () {
      var str = "";
      $("select[name='cname'] option:selected").each(function () {
            str += $(this).text() + " ";

          });

            jQuery.ajax({
            type: "POST",
            url:"",
            data:  $("form#a").serialize(),

            success: function(data){
                jQuery(".res").html(data);

                $('#test').html(data);


            }
            });  
            var str = $("form").serialize();
            $(".res").text(str);
    });
    });
    </script>
</div>
$('#nameFont').change(function() {


                    var nameFont=document.getElementById('nameFont').value;//alert(nameFont);

                    $('#nameFontDiv').html(changefontfamily);


         });

I made a JSFiddle example http://jsfiddle.net/LU24D/1/ (smaller than yours) to show how the select change works. Also, I decreased the amount of logic in your variable 'str'.

 $(document).ready(function(){
 $("select[name='cname']").change(function (evt) {
 evt.preventDefault();
       var str = $("select[name='cname'] option:selected").text();
           alert(str);
     });
 });