Hi, I want to remove a certain collection item when it equals CRNA but this line never becomes true and it never triggers the hide action inside is there anything missing from this code?
<script>
$(".job-search_item").each(function (index) {
if ($(this).find(".card-link-specialty").text() === "CRNA") {
$(this).find(".card-link-specialty").hide();
}
});
</script>
Here is my site Read-Only: Webflow - Health Carousel Locum Tenens
webdev
(Jeff Selser)
January 6, 2023, 6:46pm
2
Please follow the posting guidelines for this forum category.
memetican
(Michael Wells)
January 6, 2023, 7:38pm
3
Most likely it’s executing before the DOM is loaded.
Use jQuery’s on ready;
$(function() {
... your code here ..
});
Make sure it’s in the </body>
custom code area as well, so jQuery is loaded. I didn’t check.
thanks, that part does work but it just wont go inside this part
if ($(this).find(".card-link-specialty").text() === "CRNA")
memetican
(Michael Wells)
January 9, 2023, 10:59pm
6
You have a script error that’s terminating execution, probably before the point your desired code will run.
thanks! I’ll let the team know as I’m not familiar with the other code causing the issue.