I have a div generated through a plugin that I want to hide when disabled=true. After reading through the posts on SO, I thought maybe I could use .attr to find the disabled=true and then addClass to hide it with CSS display: none. I can't edit the plug-in or source code, so I'm hoping I can do this from the front end through our CMS. I'm a jQuery beginner so maybe this isn't possible?
I want to hide the disabled arrows in the carousel at the bottom of this page. The HTML looks like this after it is generated by the plugin:
<div class="jcarousel-prev jcarousel-prev-horizontal jcarousel-prev-disabled jcarousel-prev-disabled-horizontal" style="display: block;" disabled="true"></div>
and I have added this code to the CMS but it's not working. I don't see any errors in the console; is this the right approach? Is there something wrong with my syntax?
if ($('div.jcarousel-prev.jcarousel-prev-horizontal.jcarousel-prev-disabled.jcarousel-prev-disabled-horizontal').attr('disabled', true)){
$(this).addClass("arrow");
}
Thanks in advance for any help.