jquery - Change color to label -


i have label, dinamically created

<label onclick="amplicon_click(this)" id="ampl1324730364" >ampl1324730364</label> 

in document ready function call changecolor function change color, doesn't work. tried change jquery , css , doesn't work either. what's wrong here?

    $(document).ready(function() {                 var circos_amplicon = "<?php echo $circos_amplicon; ?>";             amplicon_click(circos_amplicon);                             changecolor("ampl1324730364",'orange');                             $("#ampl1324730364").css("color", "orange");      });       function changecolor(id, newcolor) {         $("#" + id).css("color", newcolor);     }   

thanks

you can css. add class label

<label class="lbl" onclick="amplicon_click(this)" id="ampl1324730364" >ampl1324730364</label> 

then, in css,

.lbl{ color:red } 

or can jquery also

jquery

$(".lbl").css("color", "red"); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -