Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($arr as $key => $value) {
- <select class="active" name="active">
- <option><?=$value['active']?></option>
- <option class="sec_act"></option>
- </select>
- }
- $('.active').each(function(){
- if($(this).val() == 'active'){
- $(this).closest('.sec_act').html('noactive');
- }else{
- $(this).closest('.sec_act').html('active');
- }
- });
- $('.active option:first-child').each(function (index, option) {
- if ($(option).val() == 'active')
- $(option).closest('select.active').find('option.sec_act').text('noactive')
- else
- $(option).closest('select.active').find('option.sec_act').text('active')
- })
Add Comment
Please, Sign In to add comment