694 posts
  • Beta Tester
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
  • Referred between 10 and 49 users
  • Sold between 5 000 and 10 000 dollars
HaziqMir says

Hello everyone! I am in the midst of coding a nav menu which has the general struture like this:

<div class="navMenu">
   <ul class="leftMenu">
        <li>
             <a href="#"></a>
        </li>
        <li>
             <a href="#"></a>
        </li>
         ...
   </ul>
</div>

Now, I am trying to duplicate the anchor link and put the duplicate of each one in its respective <li /> parent. But I have not been able so far to do this. Can you guys help, please? Hope you understand my problem.

Thnx in advance
-Haziq

659 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
  • United States
luckykind says

What’s the general structure SUPPOSE to look like?

use pre tags… they work better than code tags…

1182 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
campolar says
What’s the general structure SUPPOSE to look like? use pre tags… they work better than code tags…
Here’s what i can figure out from his code tags (in pre tags):
<div class="navMenu">
    <ul class="leftMenu">
        <li> <a href="#"></a> </li>
        <li> <a href="#"></a> </li>
        <li> ... </li>
    </ul>
</div> 
1182 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
campolar says
Now, I am trying to duplicate the anchor link and put the duplicate of each one in its respective <li /> parent. But I have not been able so far to do this. Can you guys help, please? Hope you understand my problem. Thnx in advance
-Haziq

And to answer you, i don’t understand you. You want to duplicate an anchor tag (which is already inside an li and then put it in its “respective” li… I’m getting mixed up :|

659 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
  • United States
luckykind says

Sorry… What I meant was, what is the end result suppose to look like…

I too am confused at were the new anchor tags should be placed…

1799 posts
  • Has been a member for 5-6 years
  • Germany
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 5 000 and 10 000 dollars
  • Envato Studio (Microlancer) Beta Tester
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
BroOf says

I also don’t understand. You want to put a copy of your link into the li item like this:

<li>The link</li>

or like this:

<li title="The link"></li>
694 posts
  • Beta Tester
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
  • Referred between 10 and 49 users
  • Sold between 5 000 and 10 000 dollars
HaziqMir says

I want to make a copy of each anchor tag and put it in its parent element i.e. li tags. I just want to add an extra hover class to the duplicate anchor tag. Got it?

1182 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
campolar says

Ah i get it. You’re trying to have the same thing written twice (while HTML has it only once?)?

659 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 10 000 and 50 000 dollars
  • United States
luckykind says
I want to make a copy of each anchor tag and put it in its parent element i.e. li tags. I just want to add an extra hover class to the duplicate anchor tag. Got it?

No… you said the same thing the first time and nobody understood what you’re talking about…

Is it hard to give an example of the end result of the HTML you’re trying to produce after the Jquery script executes?

1182 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
campolar says
I want to make a copy of each anchor tag and put it in its parent element i.e. li tags. I just want to add an extra hover class to the duplicate anchor tag. Got it?

No… you said the same thing the first time and nobody understood what you’re talking about…

Is it hard to give an example of the end result of the HTML you’re trying to produce after the Jquery script executes?
Well according to my thinking, he means something like this:
<li><a href="#">parent</a></li>
<li class="sub"><a href="#">duplicate</a></li>
by
by
by
by
by
by