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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:16:02+00:00 2026-05-29T19:16:02+00:00

I have a container and inside that I have several anchor tags. These anchor

  • 0

I have a container and inside that I have several anchor tags. These anchor tags has same class names. Now I want to get all anchor tags with class name lets say clickMe inside container. and apply a plugin to only them.

here is what I have

<div class="container">
    <a href="#" class="button" rel="btn1">Task box 1</a><br />
    <a href="#" class="button" rel="btn2">Task box 2</a><br />
    <a href="#" class="button" rel="btn3">Task box 3</a><br />
    <a href="#" class="button" rel="btn4">Task box 4</a><br />
    </div>

EDIT

Here is my plugin code

(function() {
$.fn.tasks = function(userOptions){
    this.each(function() {
        var opts = $.extend({
            'speed'     : 200
        }, userOptions);

        var ael = $(this).find('a.button');
        var container = $(this); //'.' + opts.container;
        var speed = opts.speed;
        //alert(container);
        var backdrop = $('<div></div>').addClass('backdrop');
        var box = $('<div></div>').addClass('box');

        $(ael).click(function() {
            //alert(speed);
            var rel = $(this).attr(rel);
            alert("rel");
            $(box).html(rel);
            $(container).append(backdrop, box);
            $(backdrop).animate({'opacity' : '.50'}, speed, 'linear');
            $(box).animate({'right' : '0'}, speed, 'linear');
            $(backdrop,box).css('display', 'block');
        });

        $(backdrop).click(function() {
            closeBox();
        });

        function closeBox() {
            $(box).animate({'right' : '-500'}, speed, 'linear', function() {
                $(backdrop).animate({'opacity' : '.0'}, speed, 'linear', function() {
                    $(backdrop,box).css('display', 'none');
                });
            });
        }
    });
}
}(jQuery))
  • 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-05-29T19:16:12+00:00Added an answer on May 29, 2026 at 7:16 pm

    Assuming I’ve understood your question correctly, it’s as simple as this:

    $(".container a.clickMe").yourPlugin();
    

    .container – Finds elements with class “container”

    a.clickMe – Finds descendants of .container that are a elements with class “clickMe”

    You should probably start (as mentioned in comments on your question) by reading the jQuery documentation, as this is pretty much as basic as it gets.

    Edit (see comments)

    In your plugin, this will most likely refer to the set of matched elements. You can therefore iterate over this using each, and use find to get the descendant a elements:

    this.each(function() {
        var aElems = $(this).find("a.clickMe");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView container that has two UIImageView s inside it, one partially
I want to have 3 divs aligned inside a container div, something like this:
I have a div[class=container] and inside is div[class=item] like: <style type=text/css> .container{ height:50vh; width:
I have several apps inside iframes in the page that consolidates the apps (it
I have a BorderContainer with several objects inside of it. I want it to
I have an instance of UIToolbar that contains a UITextField inside. I'd like to
I have a page on a website that contains a secure form inside an
I have an array set inside a velocity template that contains some paths. The
Suppose I have a solution inside a TFS collection that contains 3 projects. Ho
I have an iframe container inside the body section and a button. Any click

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.