Show an Anchor tag in an ASP.Net page with JQuery -


I have an asp.net page in which I have an HTML anchor tag and I see the visual property false. I want to make it visible with JQuery, but it can not seem to work. I have tried to select the selector for anchor tag, and a class selector, but there is no effect. Here's the markup for anchor tags:

  & lt; A runat = "server" class = "reg" visible = "false" id = "RegisterSoftwareTab" href = "../ RegisterSoftware ASPX" & gt; Register Software & lt; / A & gt;  

And here is the JQuery code:

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('a'). Attr ("visible", "true"); $ ('a'). Show (); $ ('.reg'). Attr " Visible "," true "); $ ('.reg'). Show ();}); & Lt; / Script & gt;  

visible is not the right attribute to use ; It is not defined by the HTML standard; You can use the visible attribute on a single ASP.NET control as asp: button ; visible = "false" will then be provided for a style = "display: none" , which is HTML compliant.

If you want to hide your element using the normal HTML tag, try using display CSS property directly in the HTML tag:

 < Code> & lt; A runat = "server" class = "reg" style = "display: none;" id = "RegisterSoftwareTab" href = "../ Register Software.aspx" & gt; Register Software & lt; / A & gt;  

To display the element's element : Inline to switch to show () is the method, so this case Show you only $ ('.reg') Show () or $ ('a'). Code> CSS property directly using attr () method without changing , :

 < Code> & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('a'). Show ();}); & Lt; / Script & gt;  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -