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

Related Questions

I am new to Jquery and need some help: I have a div, I
i am new in Cassandra db. need help to create data model. i have
i'm new at IPhone SDK Developing and now i need some help. I have
I am somewhat new to blocks and need some help. I want to store
I am very new to jquery and need some help. I am trying to
I need some help passing arguments to a jquery function. I have an html
I'm new to jquery mobile and need some help to move further in my
I'm somewhat new to SQL and need help with query syntax. My issue involves
I need help creating a regular expression for redirecting my old URL's to new
Hello i am new in android and i really need help with something. I

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.