I found a plenty of examples on how to escape characters that in css mean something else. However I couldn't find a way to escape or ignore characters from other languages.
This is the code I have:
$("input[value='aaabbbcccż uuuąaaę']").change(function() {
console.log('change event fired');
if (this.checked) {
$('#text-block').fadeIn('slow');
} else {
$('#text-block').fadeOut('slow');
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<span class="wpcf7-form-control wpcf7-checkbox"><span class="wpcf7-list-item first">
<input type="checkbox"
name="choose-what-pl[]" value="aaabbbcccż uuuąaaę">
<span class="wpcf7-list-item-label">Option A</span></span>
<span class="wpcf7-list-item"><input type="checkbox"
name="choose-what-pl[]" value="aaaa bbb ę dsfsd jiojuoi sdfds lłdsóą">
<span
class="wpcf7-list-item-label">option X</span></span>
<span class="wpcf7-list-item last">
<input type="checkbox" name="choose-what-pl[]"
value="safas łsdfs xc óxzc ż">
<span class="wpcf7-list-item-label">Option Y</span></span>
</span>ł
This code is not working.
However if I change the html and I give a value of aaabbbcccz uuuaaae
then the following code works:
$("input[value='aaabbbcccz uuuaaae']").change(function(){
if (this.checked) {
$('#text-block').fadeIn('slow');
}
else {
$('#text-block').fadeOut('slow');
}
});
Here is the sample HTML:
The problem is that I cannot change the HTML and I have to reach to the checkboxes only via value
because it's the only changing element among a huge number of checkboxes.
I've also checked the different selectors * ~ ^, etc. But I couldn't find any that could help.
The website where the form and .js file are hosted do have in the head:
<meta charset="UTF-8" />
Please suggest how I can resolve that.