select box get selected value onload
Hi !
this code actually works for me but only when select box change
- jQuery(function($) {
- ///////////////////////////////
- $( "#selectbox" ).change(function() {
- var country = $('#selectbox').val();
- if(country == 'extra'){
- $('#selectbox-extra').attr('data-hidden', 'show');
- } else{
- $('#selectbox-extra').attr('data-hidden', 'hidden');
- }
- });
- /////////////////////
- });
I want to check onload AND onchange if option = 'extra' is selected and then apply or not $('#selectbox-extra').attr
thanks to all !