Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 11060 |  Welcome, Guest!   Register  Login
 Home > Forums > jQuery > How to Show a Div in JavaScript or JQuery ...
Vuyiswamb

How to Show a Div in JavaScript or JQuery

Replies: 2 | Posted by: Vuyiswamb on 6/18/2012 | Category: jQuery Forums | Views: 404 | Status: [Member] [MVP] [Administrator] | Points: 10  


Good Evening All

I have a small issue here. I have a Div inside a TD that is defined like this

 <td    >

<div id="divGoogleEarthMap" runat="server" style="display:none"
>
<asp:HiddenField ID="HiddenField1" runat="server" />
<asp:ImageButton ID="GoogleEarthMap" runat="server" Height="100px"
OnClientClick="javascript:showimage('GoogleEarthMap'); return false;"
Width="100px" />
</div>
</td>


now the display style of this div is hidden. so i have a Javascript that runs when i close my popup. the first thing that javascript does is to populate two textboxes and show this div. It populate the textboxes nicely , but it fails to show or unhide the div. i have tried to set of code example using the normal javascript and also JQuery as depicted below



$('#divGoogleEarthMap').css('display', "block;");


and


 var div = document.getElementById("divGoogleEarthMap");

div.style.display = "block";


or


         document.getElementById('divGoogleEarthMap').style.display = 'block';


but still my Element cant be displayed.

Please note that i have a Sample Project that i can be supplied on request

Thanks

Thank you for posting at Dotnetfunda
[Administrator]


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Ajay.Kalol
Ajay.Kalol  
Posted on: 6/18/2012 11:53:53 PM
Level: Starter | Status: [Member] | Points: 50

Resolved

Try with

var div = document.getElementById('<%= divGoogleEarthMap.clientID %>);
div.style.display = "block";

when you want to display your div.

http://ajaypatelfromsanthal.blogspot.in

Vuyiswamb, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Vuyiswamb
Vuyiswamb  
Posted on: 6/19/2012 2:17:35 AM
Level: NotApplicable | Status: [Member] [MVP] [Administrator] | Points: 25

Thank that did the trick

Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/19/2013 3:41:41 AM