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

The Archive Base Latest Questions

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

I have question please refer the following code to understand the question. (I removed

  • 0

I have question please refer the following code to understand the question. (I removed ‘<‘ and ‘>’ character from the following html code because otherwise the html tags will not be visible so i have written only tag names)

<div>
    <div>
       <img />
       <img />
       <img />
       <img />
    </div>
</div>

I want to solve following task with the help of jQuery

  1. On document ready out of four img between the inner div only first img should be visible and rest of the three img should get hidden.
  2. Now on particular event like focus, click etc. the out of four img between the inner div the visible img get hide and the other one should get visible.

Some other questions:

  1. Is jQuery is able to identify only those elements enclosed by other tag?

  2. I also want to know how the control flows in jQuery? specially in chained function.
    for EX.

    1. $(selector).fun1(val,{fun2(){ }}
      in above example which function is get executed first and in what sequence.

    2. $(selecter).fun1().fun2().fun3()
      in above example which function is get executed first and in what sequence.

    3. In what sequence the functions in function chaining is get executed?

Waiting for your reply guys!

  • 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:53:47+00:00Added an answer on May 13, 2026 at 2:53 pm

    Try something like I did here.


    The first image (twitter) does not change, as per your requirements. The only images that are affected are the ones in the div that has the class sample

    HTML

    <img src="https://s3.amazonaws.com/twitter_production/a/1265328866/images/twitter_logo_header.png"/>
    
    <input type="text"/>
    <input type="text"/>
    <input type="text"/>
    <input type="text"/>
    
    <div class="sample">
      <img src="http://sstatic.net/so/img/logo.png">
      <img src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif">
      <img src="http://cacm.acm.org/images/logo.ACM.gif">
      <img src="http://static03.linkedin.com/img/logos/logo_linkedin_88x22.png">
    </div>
    

    JavaScript

    $(function () {
        var textboxes = $("input:text"), //gets all the textboxes         
            images = $(".sample img");   //gets all the images
    
        images.not(":first").hide(); //hide all of them except the first one
        textboxes.each(function (i) {
            var j = i;
            $(this).focus(function () {
                images.hide().eq(j).show();
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this simple question please. I have this part of code which sets
Please refer to the following code: Filename: myclass.h @interface myclass:NSObject ... @end @interface NSObject(CategoryName)
I am quite new to programming, i have a question please help me. (
I have a homework question please help with a little explanation so that I
I have a question with respect to Spring , please excuse if my Question
may be too simple groovy question but....please help i have a list like this:
(Please note that I have seen a similar question on StackOverflow recently, however I
Please excuse the noob-ish nature of this question. I have a project in which
Let me preface this question. I have just started using jquery, so please be
I have question about parsing in Html helper : I have sth like: @foreach

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.