I am encountering an issue with my jQuery file
jQuery(document).ready(function() {
var orderId= <%= OrderLi.ClientID %>;
jQuery("#ApprovalTab").css("display", "block");
jQuery("#ApprovalLi").css("background-color", "#5EA8DE");
jQuery("#ApprovalLi a").css("color", "#FFF");
jQuery("#OrdersTab").css("display", "none");
jQuery("#ApprovalLi a").css("border-bottom", "3px #5EA8DE solid");
jQuery("#ApprovalLi").click(function() {
jQuery("#ApprovalTab").css("display", "block");
jQuery("#ApprovalLi").css("background-color", "#5EA8DE");
jQuery("#ApprovalLi a ").css("color", "#FFF");
jQuery("#orderId a").css("color", "black");
jQuery("#Arrow").css("margin-left", "15px");
jQuery("#ApprovalLi a").css("border-bottom", "3px #5EA8DE solid");
jQuery("#orderId a").css("border-bottom", "3px #D8D9DC solid");
jQuery("#orderId").css("background-color", "#F0F1F4");
jQuery("#OrdersTab").css("display", "none");
});
jQuery("orderId").click(function() {
jQuery("#ApprovalTab").css("display", "none");
jQuery("#OrdersTab").css("display", "block");
jQuery("#Arrow").css("margin-left", "112px");
jQuery("#orderId").css("background-color", "#5EA8DE");
jQuery("#orderId a").css("border-bottom", "3px #5EA8DE solid");
jQuery("#ApprovalLi a").css("border-bottom", "3px #D8D9DC solid");
jQuery("#ApprovalLi").css("background-color", "#F0F1F4");
jQuery("#orderId a").css("color", "#FFF");
jQuery("#ApprovalLi a").css("color", "black");
});
jQuery("#orderId").hover(function() {
jQuery("#orderId a").css("border-bottom", "3px #5EA8DE solid");
});
jQuery("#ApprovalLi").hover(function() {
jQuery("#ApprovalLi a").css("border-bottom", "3px #5EA8DE solid");
});
});
This jQuery code is being applied to the following HTML structure:
<ul class="etabs">
<li id="ApprovalLi"><a href="#stopAtTop">Approval </a></li>
<li id="OrderLi" runat="server" ><a href="#stopAtTop">Orders</a></li>
</ul>
The problem arises when I use the attribute 'runat="server"' in my HTML code. Without it, everything works fine. I know that the ID changes when using this attribute, but as seen in the jQuery above, I have accounted for this by using the server-generated ID.
Although I could optimize the code, my primary concern is getting it to work correctly first.
Can anyone offer insight into what else might be causing this issue?
Thank you.