Issue with changing label color
<p>I am not a web developer but trying to fix something in code, so please excuse me if I am overlooking something.</p>

<p>I am trying to disable a checkbox and label when another checkbox is checked. </p>

<p>This is how my html looks like:</p>

<pre><code>&lt;dl id="someParent"&gt;
&lt;dd&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"/&gt;
&lt;label for="checkbox1" data-localize="someText.name1" class="checkbox1"&gt;   &lt;/label&gt;
&lt;/dd&gt;&lt;dd&gt;
&lt;input type="checkbox" name="checkbox2" id="checkbox2"/&gt;
&lt;label for="checkbox2" data-localize="someText.name2" class="checkbox2"&gt; &lt;/label&gt;
&lt;/dd&gt;&lt;div class="clear"&gt;&lt;/div&gt;&lt;/dl&gt;
</code></pre>

<p>JS:</p>

<pre><code>$('#checkbox1').click(function() {
 if( $("#checkbox1").is(':checked') ){
    $('#checkbox2').attr("disabled", true);
    $('label[data-localize="someText.name2"]').css("color", "red"); //This doesn't work 
  } else {
    $('#checkbox2').removeAttr('disabled');
    //Code to change label color. How, to access data-localize="someText.name2"? Where someText.name2 is defined in a json file as string, someText.name2: "This will be printed as label 1"
  }
});                            

$('#checkbox2').click(function() {
 if( $("#checkbox2").is(':checked') ){
   $('#checkbox1').attr('disabled', true);
    //Code to change label color. How, to access data-localize="someText.name1"? Where someText.name1 is defined in a json file as string, someText.name1: "This will be printed as label 2"
    } else {
       $('#checkbox1').removeAttr('disabled');
       $('label[data-localize="someText.name1"]').css("color", "black"); //This doesn't work 
    }
});
//My issue is I can not access and hence change color of "someText.name1/2" which is a label/text next to the Checkbox1/2. Disabling the Checkbox is not an issue but greying out the label next to checkbox is an issue.
</code></pre>

<p>In the original code, the program replaces someText.name1/2 with a mapping string from json file as a label. </p>

<p>I can make it work if I use a label in html(as seen in jsfiddle where I have used Checkbox1,2 as label), but not when code replaces the data-localize string from json file. The checboxes themselves are working correctly but the label doesnt change color.</p>

<p>Note: I can't change the architecture of code, therefore I have to use data-localize only. Also, this question is not about changing the color of label, but about how to access and change the label when data-localize is used.</p>

<p>Also, Checkbox1 and Checkbox2 labels are not in the original code instead they are generated dynamically replacing someText.name1 and someText.name2.</p>

<p>Example: <a href="https://jsfiddle.net/w8s9rLme/34/" rel="nofollow">https://jsfiddle.net/w8s9rLme/34/</a>  </p>