Click here to Skip to main content
15,914,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a link
C#
<a href="#" id="mya"   >My Text</a>


On button click i display a div id
C#
function ShowItems() {
        document.getElementById("Cars").style.display = "block";
        var dolj = document.getElementById("mya").innerHTML = "My Text2"
        if (dolj){
            document.getElementById("Cars").style.display = "none";
        }


so in my click event for my a link i first display my cars id and then on click change the text of my a href,

Right now its changing my text of my a link but display:block on my div Cars are not showing why?
Posted
Comments
Mohibur Rashid 20-Mar-15 5:02am    
because your dolj is valid. That is why in if condition display is getting none.

1 solution

comment out this part:
C#
/*
if (dolj){
    document.getElementById("Cars").style.display = "none";
}
*/
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900