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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:31:59+00:00 2026-06-10T20:31:59+00:00

So I have 2 links that I would like to show if javascript is

  • 0

So I have 2 links that I would like to show if javascript is on and hide when it is off, and when the javascript is off, I would like to show 2 other links in its place with noscript tag.

What I have so far is:

-js here-
show 2 links if js is on and hide when it is disabled
-js here-

-noscript-
link 1
link 2
-noscript-

I only have experience in PHP and am not very familiar with javascript.

What would be the best way to go about this? Should there be a javascript function of some kind to make the show/hide function work? But if javascript is off, how will the function run to hide the links?

If someone can point me in the right direction to go about this or provide me with a simple code snippet, I would really appreciate it. Thanks!

  • 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-06-10T20:32:00+00:00Added an answer on June 10, 2026 at 8:32 pm
    1. Hide the links using CSS – not visible by default

      <a id="link1" href="#" style="display: none">Script link 1</a>
      <a id="link2" href="#" style="display: none">Script link 2</a>
      
    2. Show the links using Javascript – they are only visible if Javascript is on, of course

      <script type="text/javascript">
           document.getElementById('link1').style.display="block";
           document.getElementById('link2').style.display="block";
      </script>
      

      Depending on what you need, you can use any other display property (link is inline by default, I added block here, use whichever you need).

    3. Add the noscript stuff – only visible when Javascript is off

      <noscript>
      -two other links-
      </noscript>
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 5 links that are on the same form but I would like
I have a page that has a few links that I would like to
I have links like these that I want to change: mypage.com?page=missions&id=5 mypage.com?page=hello I tried
Change all links that have an image in it to: javascript(alert(thehref)); eg. <a href=/galleries/anna-leah-111827/image01.html><img
I have some javascript I would like to execute only if a user is
I have a list of items with some details that I would like to
I have a sticky side menu that I would like to have be able
I have a link that takes me to an image. How would I go
On my website I have links that are as follows, (shortened for easiness) <a><h2
I currently have a series links that open menus containing dropdowns and input textboxes

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.