samedi 18 avril 2015

Master pages with jquery selector

i am using asp.net + bootstrap ,i want to add active class automatically using jquery to different navbar items.Now the problem is i am using master pages so i am confused with which selector to use and when i do inspect element for my page ,then only thing changing is



<form method="post" action="Home.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">


and



<div id="home"></div>//id of the different pages


the action attribute in this page ,and i am not able to select item on this basis,Means



$('form:contains('Home.aspx')') //this is not working


i want java selector like



$("h2:contains('something')")


then



$("ul.nav-pills a:contains('Home')").Parent().addClass('active');


how can i relate both?


Aucun commentaire:

Enregistrer un commentaire