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

The Archive Base Latest Questions

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

I working with an existing website, with some anchors tags like so: <ul> <li><a

  • 0

I working with an existing website, with some anchors tags like so:

<ul>
    <li><a id="answer-1" href="/" rel="0">Answer 1</a></li>
    <li><a id="answer-2" href="/" rel="1">Answer 2</a></li>
    <li><a id="answer-3" href="/" rel="2">Answer 3</a></li>
    <li><a id="answer-4" href="/" rel="3">Answer 4</a></li>
</ul>

I need to programmatically click one of these anchors depending on the user’s selection.

On the desktop, in IE, this works:

document.getElementById('answer-1').click();

However, doesn’t quite work in iOS safari, this results in a popup:

if (!document.getElementById('answer-1').click) alert ('Oh no!');

Best I can tell, they have some other javascript hooked up using to send the rel tag as an answer. Is there another way to programmatically click the anchor in iOS Safari? Or do I need to go digging in their javascript to find out what is being called when the anchor is clicked?

I have also tried this, which doesn’t work:

window.location.href = document.getElementById('answer-1').href;

They must be doing more in Javascript somewhere (maybe jquery).

  • 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-28T19:55:28+00:00Added an answer on May 28, 2026 at 7:55 pm

    I’ve answered to a similar question where one needs to dispatch click event manually: Force link to open in mobile safari from a web app with javascript

    You can apply that logic into your code.

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

Sidebar

Related Questions

I have been working with an existing website out company has running until I
I'm working on some existing code. After a few hours, I've boiled this problem
I'm working on some existing c++ code that appears to be written poorly, and
I am working on an existing project, setup by another coder. I'm having some
I'm working with an existing Android app and I need to have a dynamically
So I'm currently working on rebuilding an existing website that is used internally at
I've inherited some code that I need to debug. It isn't working at present.
I am currently working on an existing website that lists products, there are currently
The website I'm working on has some fairly complicated routing structures and we're experiencing
I am currently working on a project / website and I will need to

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.