<div class="selectbox">
    <label for="ex_select">국적선택</label>
    <select id="ex_select">
        <option selected>국적선택</option>
        <option>한국</option>
        <option>일본</option>
        <option>중국</option>
    </select>
</div>

<a href="http://webdir.tistory.com/432" target="_blank" class="where">posted in webdir</a>
body{
  margin: 10px;
  font-size: 14px;
}
.where {
  display: block;
  margin: 25px 15px;
  font-size: 11px;
  color: #000;
  text-decoration: none;
  font-family: verdana;
  font-style: italic;
}

.selectbox {
  position: relative;
  width: 200px;
  border: 1px solid #999;
  z-index: 1;
}

.selectbox:before {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 0;
  height: 0;
  margin-top: -1px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #333;
}

.selectbox label {
  position: absolute;
  top: 1px;
  left: 5px;
  padding: .8em .5em;
  color: #999;
  z-index: -1;
}

.selectbox select {
  width: 100%;
  height: auto;
  line-height: normal;
  font-family: inherit;
  padding: .8em .5em;
  border: 0;
  opacity: 0;
  filter:alpha(opacity=0);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
$(document).ready(function(){
  var selectTarget = $('.selectbox select');

 selectTarget.on('blur', function(){
   $(this).parent().removeClass('focus');
 });

  selectTarget.change(function(){
    var select_name = $(this).children('option:selected').text();

  $(this).siblings('label').text(select_name);
  });
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://code.jquery.com/jquery-1.11.3.min.js