Guest User

Untitled

a guest
Oct 23rd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. foreach ($arr as $key => $value) {
  2. <select class="active" name="active">
  3. <option><?=$value['active']?></option>
  4. <option class="sec_act"></option>
  5. </select>
  6. }
  7.  
  8. $('.active').each(function(){
  9.  
  10. if($(this).val() == 'active'){
  11. $(this).closest('.sec_act').html('noactive');
  12. }else{
  13. $(this).closest('.sec_act').html('active');
  14. }
  15. });
  16.  
  17. $('.active option:first-child').each(function (index, option) {
  18. if ($(option).val() == 'active')
  19. $(option).closest('select.active').find('option.sec_act').text('noactive')
  20. else
  21. $(option).closest('select.active').find('option.sec_act').text('active')
  22. })
Add Comment
Please, Sign In to add comment