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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:36:55+00:00 2026-05-28T15:36:55+00:00

I have a text box input in a form; when I click it, a

  • 0

I have a text box input in a form;
when I click it, a link appears next to it. When I click outside the text input box, the link gets hidden.

I have this code that changes style of the text box input field and hides the link:

$('#txtbox').blur(function(){
$('#txtbox').removeClass('active');
$('#txtbox').addClass('passive');
$('#link').hide();
});

I’d like to be able to click on the link, but when I click wherever outsite the text box, the link gets hidden.

How can the link remain visible when I click on it, but also to get hidden when I click outsite the textbox and when I don’t click on the link?

  • 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-28T15:36:56+00:00Added an answer on May 28, 2026 at 3:36 pm

    Try this.

    $(function(){
       $(document).click(function(){
          $('#link').hide();
       });
       $('#link').click(function(e){
          e.stopPropagation();
          //Do other stuff on click of link here
       });
       $('#txtbox').blur(function(){
           $('#txtbox').removeClass('active').addClass('passive');
       }).focus(function(e){
           $('#txtbox').addClass('active').removeClass('passive');
           $('#link').show();
       }).click(function(e){
            e.stopPropagation();
       });
    });
    

    Demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
This jquery code below is for a text input box to help users enter
I have a <form /> with a text box, and an <input /> button.
I have this link that creates a few div's in which a form is
I have a text input field like text box or text area. I want
I have a drop down box and some text input fields below it. Based
I have an if statement that needs to look like this: UPDATE $(input#textbox).keypress(function(e){ key==e.which;
I have a text box that is going to be validated in JavaScript upon
I have a Date Input text box generated by jquery Date Picker which is
So I have an input form that I want to use to update a

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.