0

I have this part of code in my html:

<ul style="display: block;">
   <li id="id_00002135.cream-multi"><button id="id_00002135.cream-multi_heatmap_button">heatmap</button><a href="#" id="id_00002135.cream-multi_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00001392.mustard-blue"><button id="id_00001392.mustard-blue_heatmap_button">heatmap</button><a href="#" id="id_00001392.mustard-blue_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00003453.purple"><button id="id_00003453.purple_heatmap_button">heatmap</button><a href="#" id="id_00003453.purple_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00003435.cream-pink"><button id="id_00003435.cream-pink_heatmap_button">heatmap</button><a href="#" id="id_00003435.cream-pink_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00002158.purple"><button id="id_00002158.purple_heatmap_button">heatmap</button><a href="#" id="id_00002158.purple_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00000562.black-pink"><button id="id_00000562.black-pink_heatmap_button">heatmap</button><a href="#" id="id_00000562.black-pink_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00000122.grey-red"><button id="id_00000122.grey-red_heatmap_button">heatmap</button><a href="#" id="id_00000122.grey-red_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00004865.black-purple"><button id="id_00004865.black-purple_heatmap_button">heatmap</button><a href="#" id="id_00004865.black-purple_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00006450.taupe-navy"><button id="id_00006450.taupe-navy_heatmap_button">heatmap</button><a href="#" id="id_00006450.taupe-navy_image"><img src="xxx" style="max-width: 250px;"></a></li>
   <li id="id_00003229.black-red"><button id="id_00003229.black-red_heatmap_button">heatmap</button><a href="#" id="id_00003229.black-red_image"><img src="xxx" style="max-width: 250px;"></a></li>
</ul>

but when I try to get the jquery element of 'a' elements jQuery can't seems to find it. When I run the code:

$("#id_00000122.grey-red_image")

this is the output: enter image description here

What am I doing wrong?

Kenny Smith
  • 729
  • 3
  • 9
  • 23
  • Or [special characters in id of html tags](https://stackoverflow.com/questions/6675454/special-characters-in-id-of-html-tags) – Andreas Jun 28 '20 at 10:45
  • Or [How do I select an element with special characters in the ID?](https://stackoverflow.com/questions/44900544/how-do-i-select-an-element-with-special-characters-in-the-id) – Andreas Jun 28 '20 at 10:46
  • `$('[id="id_00000122.grey-red_image"]')` – connexo Jun 28 '20 at 10:48

0 Answers0