I'm currently attempting to modify the text color of the h2 title with the id ticketSearchTitle
when the ticketSearch
div is not visible. However, the code I have been using to achieve this seems to cause issues (such as the absence of a pointer icon on the title and inability to hide the div).
Here is the structure of the div:
<h2 id="ticketSearchTitle" >SEARCH</h2>
<div id="ticketSearch"><div>
Below is the complete code snippet:
$("h2#ticketSearchTitle").css({'cursor':'pointer', 'display':'inline'});
$("h2#ticketSearchTitle").click(function(){
$("#ticketSearch").toggle('slow');
//modify h2 text to indicate it is inactive
if ($("h2#ticketSearch").is(':hidden')){
$("#ticketSearchTitle").css('color','#D3D3D3')
}
});
Snippet in JQuery that causes the issue:
//change h2 text to show that is inactive
if $("h2#ticketSearch").is(':hidden'){
$("#ticketSearchTitle").css('color','#D3D3D3')
}