javascript - What are possible reasons why my jQuery css selector isn't working? How would I fix this? -


color = "#123456";     

$('#a').css('color', "#123456");  $('#b').css('color', "#123456");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <div class="input" id="a">    <input class="col-sm-3 col-xs-3 input-co" type="text" value="#ffffff">  </div>  <div class="input" id="b">    <input class="col-sm-3 col-xs-3 input-co" type="text" value="#ffffff">  </div>

is because inline-style , need use !important rule? should do?

actually setting color @ container suppose need style input.

try catch input in way:

var color = "#123456"; $('#a input').css('color',color); $('#b input').css('color',color); 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -