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

  • Home
  • SEARCH
  • 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 581267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:33:38+00:00 2026-05-13T14:33:38+00:00

$(function(){ $(.test).each(function(){ test(); }); }); function test(){ $(this).css(border,1px solid red).append( checked); } why is

  • 0
    $(function(){
        $(".test").each(function(){
            test();
        });
    });

     function test(){
        $(this).css("border","1px solid red").append(" checked");
    }

why is this not working? what am I missing?
this is my test html:

    <p>test</p>
    <p>test</p>
    <p class="test">test</p>
    <p>test</p>
  • 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-13T14:33:38+00:00Added an answer on May 13, 2026 at 2:33 pm

    The $(this) cannot be used in that way, because you don’t specify the context of the test() function:

    $(".test").each(function(){
            test($(this));
    });
    
    function test(el){
         el.css("border","1px solid red").append(" checked");
    }
    

    or

    $(".test").each(function(){
          test.call(this);
    });
    function test(){
       $(this).css("border","1px solid red").append(" checked");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 539k
  • Answers 539k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The Web project generated has a class called BusinessApplication.Web.RegistrationData, which… May 17, 2026 at 2:22 am
  • Editorial Team
    Editorial Team added an answer If you're not sure whether or not your binary is… May 17, 2026 at 2:22 am
  • Editorial Team
    Editorial Team added an answer To put data in the clipboard, you want to open… May 17, 2026 at 2:22 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Im working on a HTML test page with a simple grid that has red
(Citing source at: http://jqueryui.com/demos/dialog/#modal-form ) As an example, this works great but each time
i have put in a css box colored red and for some reason the
I try to extend jQuery, but when I call myTest this will return this.myTest.test()
I'm having difficulty understanding why a particular selector isn't working for me. Admittedly I'm
I am trying to animate a div when the user click the button. Each
I'm using jQuery to position elements in a submenu. The html looks like: <div
I am working on a simplistic website using PHP, a language I haven't touched
ueach is a function that loops through a Unicode string, and running the callback
I am trying to send a variable with jQuery's getJSON function but it doesn't

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.