Changing CSS with Jquery

Asked

Viewed 133 times

0

In my select I have the list with the options, when selecting an option the content alternates as it is tied to the selects.

When I put data-Native-menu="false" select does not allow you to change the table content and when selecting another option the screen does not change.

<select id="cities" style="padding: 5px; overflow:hidden; border-radius: 5px; height: 100%;" class="empty" name="cities" data-native-menu="false" onclick="selected(this.value)" >
   <option value="Selecionar">Selecionar</option>
</select>

JS

var select = document.getElementById('cities');

    function selected(value){

    var dadosLoja = document.getElementsByClassName('dadosLoja');
        if(value != "Selecionar"){
            dadosLoja[0].style.display = 'block';
        }else{
            dadosLoja[0].style.display = 'none';
        }
    }

I’m using the

<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> 
  • When using the data-Native-menu="false" I had to change the onclick to onchange, then it worked!

1 answer

2

When using the data-native-menu="false" I had to change the onclick for onchange, there worked!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.