Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:31:09+00:00 2026-06-12T22:31:09+00:00

I have 1 link surrounding another one like this: <a href=# class=video-link> <a href=#

  • 0

I have 1 link surrounding another one like this:

<a href="#" class="video-link">
  <a href="#" class="not-video-link">link</a>
</a>

with jQuery i have found a function that can transform a table to iframe like this:

$(".video-link").live("click", function (e) {
    e.preventDefault();
    // Capture the link's HREF attribute in a variable. 
    var youtubeLink = $(this).attr('href');
    var youtubeDiv = $(this).attr('id');

    // Set the HTML (the content) of the "video destination div" 
    // to = your iframe, including the youtubeLink
    // that the user original saved into this node.

    $('#' + youtubeDiv + '').html('<iframe style="margin-left:-12px; margin-right:-12px;" frameborder="0" height="234" src="' + youtubeLink + '&autoplay=1" title="YouTube video player" width="418"></iframe>');
});

It works fine but i need to get the other “a” tag to work as normal.

the second link has class="not-video-link" and i want that to open a link as normal.

Here is the whole box:

        echo '<br />
        <div id="the-video-destination-div'.$id.'"  class="video-link" href="'.youtubelink(tolink($youtubevid)).'">
        <table style="background-color:#EDEFF4; font-size:11px; border:1px solid #ccc;">
        <tr><td><a ><img style="cursor:pointer;" align="left" src="'.$video_thumbnail.'" width="152px" height="114px" /></a></td>
        <td style="vertical-align:top; width:199px; padding:5px; cursor:default; " ><font style="color: #3B5998; text-decoration:none; font-weight: bold;"><font class="youtube-title"><a id="not-video-link" style="cursor:pointer;" href1="http://www.youtube.com/watch?v='.youtubetitle($wallrow["youtubevid"]).'" target="_blank">'.$video_title.'</a></font></font><font class="link-host"><br /><a href="http://www.youtube.com">www.youtube.com</a><br /><br />'.substr($video_description,0,149).'...</font></td></tr>
        </table></div><br />';

I have now changed from div with a href attr inside the div tag. Is that illigal?

I have found a soulution to the problem.

                $("a#not-video-link").click(function () {
                var youtubeLink1 = $(this).attr('href1');
                      window.open(youtubeLink1);
                      event.stopImmediatePropagation();

                    });

            $(".video-link").live("click", function(e) {
                    e.preventDefault();


                  // Capture the link's HREF attribute in a variable.
                  var youtubeLink = $(this).attr('href');
                  var youtubeDiv = $(this).attr('id');

                  // Set the HTML (the content) of the "video destination div" to = your iframe, including the youtubeLink that the user original saved into this node.
                  $('#' + youtubeDiv + '').html('<iframe style="margin-left:-12px; margin-right:-12px;" frameborder="0" height="234" src="' + youtubeLink + '&autoplay=1" title="YouTube video player" width="418"></iframe>');
                });

This makes the link stop the other link to launch and the other way around.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:31:11+00:00Added an answer on June 12, 2026 at 10:31 pm

    Nest Links are not allowed and simply considered as invalid construct.

    http://www.w3.org/TR/html401/struct/links.html#h-12.2.2

    12.2.2 Nested links are illegal

    Links and anchors defined by the A element must not be nested; an A
    element must not contain any other A elements.

    Since the DTD defines the LINK element to be empty, LINK elements may
    not be nested either.

    Since that is the case the browser would not render them as nested.. It would simply create below as 2 different links (See proof / picture).

    <a href="#" class="video-link">
      <a href="#" class="not-video-link">link</a>
    </a>
    

    Proof: http://jsfiddle.net/H44jE/ [click inspect and click on the links]

    Also the construct looked different on different browsers..

    enter image description here

    Note: I am not sure what you are trying.. but as flec mentioned you should look for other options..

    @Thayer no you don’t. Since you’re using preventDefault you can attach the click event to any html-tag

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have link that calls a function when clicked: <a href=javascript:spawnMenu(this); id=link1>Test1</a> To make
i have link like this <td><a href=<?php echo base_url(); ?>index.php/c_materialjasa/gkategorimaterial>Lihat Tabel</a></td> here is my
I have this link in a template: <a href={% url show_item item.id %}>Item 1</a>
I have a link which looks like that: www.domain.com/file.php I want to create .htaccess
I have a link that I want to center vertically in the .well class
I am working on an ASP.NET/C# Application. I have Link buttons like this <asp:LinkButton
I have link: <a href=/test/number/3/phone/0>33df</a> How can i check if in this link are
The Rails community has an impressive ethos surrounding things like usability that I have
i have link like this i need show detail of city in dialog box
I want have link on click of that link a javascript function is called.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.