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

The Archive Base Latest Questions

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

I need help I am new to jQuery and i want to implement jQuery

  • 0

I need help I am new to jQuery and i want to implement jQuery in one of my webpage.
I also have one form having four text boxes. I have two div tags one in another i.e. my code structure is in following way

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

I just want to do with the help of jquery that

  1. On document ready the first img should be visible out of the four <img> and rest of the three <img> should be hidden between the inner div tag and the cursor focused on first textbox.
  2. Now when focus gose to second textbox the current visible <img> should get hidden and only second <img> should be visible.
  3. When focus gose to third textbox the current visible <img> should get hidden and only third should be visible.
  4. In this way the fourth <img> should be visible when control goes to fourth text box.

Overall when focus goes to any of the textbox the <img> related to it should be visible and the remaining three <img> should be hidden.

So please help in doing above jQuery code which do the following functionality with out affecting other images on the same page except the imaged mentioned above.

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:50:48+00:00Added an answer on May 13, 2026 at 2:50 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

Ask A Question

Stats

  • Questions 286k
  • Answers 286k
  • 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 I had the same issue. In my particular case it… May 13, 2026 at 4:54 pm
  • Editorial Team
    Editorial Team added an answer you can't you will have to install some unix like… May 13, 2026 at 4:54 pm
  • Editorial Team
    Editorial Team added an answer http://msdn.microsoft.com/en-us/library/ms950721.aspx I'd start here. This should point you in the… May 13, 2026 at 4:54 pm

Related Questions

I am new to jQuery and I am using ajax request to get an
I am new to JQuery. I'm reading JQuery in action, but only up to
I need to invoke a ColdFusion function(present in a .cfm file) when the user
I have some code I was given in jQuery and I am really new
I am probably making some silly mistake but I am newer to the world

Trending Tags

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

Top Members

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.