작성일 : 16-12-09 21:49
|
[JQuery] addclass 로 개체 감추고 보이기
|
|
|
글쓴이 :
조형래
 조회 : 3,791
|
<script>
$(document).ready(function () { // 페이지가 준비되었을 때
var i =0;
$("#change_staffs").click(function() {
if(i%2==0){
$('.wr_2_option1').addClass("hide_option");
$('.wr_2_option2').removeClass("hide_option");
$("#change_staffs").attr("value", "Views Project Staffs");
}else{
$('.wr_2_option2').addClass("hide_option");
$('.wr_2_option1').removeClass("hide_option");
$("#change_staffs").attr("value", "Views All Staffs");
}
i = i + 1;
})
})
</script>
<style>
.hide_option {display:none!important;}
</style>
<input type="button" id="change_staffs" class="btn btn-sm btn-success filter-submit margin-bottom" value="Views All Staff">
<select name="wr_2" id="mb_list" required class="form-control wr_2_option1" onchange="select_staff_mb(this.value);">
<option>No Staff</option>
</select>
<select name="wr_2" id="mb_list" required class="form-control wr_2_option2 hide_option" onchange="select_staff_mb(this.value);">
<option>No Staff</option>
|
|