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 8217647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:31:58+00:00 2026-06-07T12:31:58+00:00

i have this problem that i need to get the value of href and

  • 0

i have this problem that i need to get the value of href and pass it to a button.

is this correct format of jQuery?

$(function() {
    var getValue = $('#theLink').getAttributeNode('onclick').value;
    $('.yt_holder').live('click', '.videoThumb4', function(){ 
    $(".videoThumb4").ytplaylist({
        holderId: 'ytvideo4',
        html5: true,
        playerWidth: '520',
        autoPlay: false,
        sliding: false,
        listsliding: true,
        social: true,
        autoHide: false,
        playfirst: 0,
        playOnLoad: false,
        modestbranding: true,
        showInfo: false
    });
    });
});

the button was working but it only play the first video on his list.
the link of the website is here http://cocopop12.site11.com/search/index.php

now the button is this.

<input class="videoThumb4" onClick="http://www.youtube.com/watch?v=' . $yValue['videoid'] . '" type="button" name="previewSel" value="Preview" id="previewbut" />

is that correct? that i need to do a onclick http://www.... blabla?

the <a href> that i like to make a button is this.

<?php
echo '
<a class="videoThumb4" href="http://www.youtube.com/watch?v=' . $yValue['videoid'] . '" id="link">
' . $yValue['description'] . '
</a>
';
?>

how can i use .each for the button {Preview}?
how can i put the value in the button just like –when i click this href it automatically play the video? but the button it just play the first video but not the second video.
this i want to make it like a button.

thank you for your time.

  • 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-07T12:31:59+00:00Added an answer on June 7, 2026 at 12:31 pm

    So if I have understood your question correctly, you want to have the ‘Preview’ button follow the nested anchor link when it is clicked. You can’t just do this by setting the onclick attribute, since this specifies a script to run when an event is raised — not a link to follow.

    If the a link still exists, you can have the button trigger the click on the a link when it is clicked (you already have a handler for the a link click).

    First, get rid of the onClick="..." in the button.

    Then, add the following javascript code to trigger the link click.

    $('.yt_holder').on('click', '.videoThumb4', function(e){
        e.preventDefault();
        if($(e.target).is('input[type="button"]')){
            $(this).siblings("a.videoThumb4").first().click();
        }
    }
    

    This will bind to the ‘click’ event of all .videoThumb4 elements (currently in the document or loaded in the future), check if they are html buttons, then trigger the click on the corresponding anchor link below (which is handled by your code in your question). Note .live() is deprecated, and you should use .on() as shown for similar functionality.


    Update: Your new code should look something like this

    $(function() {
        $('.yt_holder').on('click', 'a.videoThumb4', function(e){
            $('.videoThumb4').ytplaylist({
                holderId: 'ytvideo4',
                html5: true,
                playerWidth: '520',
                autoPlay: false,
                sliding: false,
                listsliding: true,
                social: true,
                autoHide: false,
                playfirst: 0,
                playOnLoad: false,
                modestbranding: true,
                showInfo: false
            });
        });
        $('.yt_holder').on('click', 'input.videoThumb4', function(e){
            e.preventDefault();
            $(this).siblings("a.videoThumb4").first().click();
        });
    ​});​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem is this: I have multiple competing threads (100+) that need to access
I have this problem that I can ref a button for control it. I
I have this little problem, that I cannot figure out which arguments to pass
I have created this function GetSubName that I need to return the name that
I have this problem that my sites uses alot of ajax and when a
Ok I have this problem that I've never had before, it's really bugging me.
So we have this problem that we are trying to figure out. Heres what
I have this problem decomposing a relation schema into a set of schemas that
I have a problem that I can't resolve. Let's say I have this map
I have this annoying problem, that Im pretty sure happens to all of you

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.