Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a code where i have this code:

XML
<div id="LeftMenue" class="col-sm-3 col-md-6 col-lg-4">

                  <ul>
                      <li><a href="#">Task2</a></li>

                      <li><a href="#">User</a></li>

                      <li><a href="#">Edit Page</a></li>

                      <li><a href="#">Save Page</a></li>

                      <li><a href="#">Patient</a></li>
                  </ul>



          </div>



and i want to write this code in main.js a javascript file :

C#
$("#LeftMenue > ul li a").click(function () {
        me.showPage();
    });



i want to take the innerhtml or the text value of the ancher tag because the div name is equal to that so when i want to hide or show a div i just need the innerhtml of the current ancher how can i do that
Posted
Updated 9-Sep-15 0:51am
v2
Comments
Andy Lanng 9-Sep-15 6:49am    
You want to make use of what, now? - Maybe review the subject of this post.

1 solution

Simples:
JavaScript
$("#LeftMenue > ul li a").click(function () {
        //'this' is the control 
        var controlClicked = this;

        var text = controlClicked.text()

        me.showPage();
    });
 
Share this answer
 
Comments
May Bash 9-Sep-15 7:17am    
thank you so much for your help

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