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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:40:59+00:00 2026-06-14T15:40:59+00:00

How can we know if the user clicked on a link a minimum of

  • 0

How can we know if the user clicked on a link a minimum of 10 times or not? If user clicks 10 times on link, then open an automatic other window to accept data from user and store it…..

Please solve it using JS and HTML.

And also how can we call JS function using “src” tag of HTML?

  • 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-14T15:41:00+00:00Added an answer on June 14, 2026 at 3:41 pm

    The link:

        <a onClick="doTheMagic('http://www.google.com/',1);" href="#">Click on it.</a> Your Total Clicked: <span id="timesClicked_1">0</span>; Remaining Total Clicked <span id="timesRequired_1">10</span>
        <br />
        <a onClick="doTheMagic('http://www.facebook.com/',2);" href="#">Click on it.</a> Your Total Clicked: <span id="timesClicked_2">0</span>; Remaining Total Clicked <span id="timesRequired_2">10</span>
        <br />
        <a onClick="doTheMagic('http://www.twitter.com/',3);" href="#">Click on it.</a> Your Total Clicked: <span id="timesClicked_3">0</span>; Remaining Total Clicked <span id="timesRequired_3">10</span>
    

    The javascript:

    var clickCounter = new Array();
    clickCounter[1] = 0;
    clickCounter[2] = 0;
    clickCounter[3] = 0;
    
    function doTheMagic(src,linkNumber){
        clickCounter[linkNumber]++;
        if(clickCounter[linkNumber] >= 10){
           poptastic(src);
        }
        document.getElementById("timesClicked_" + linkNumber).innerHTML = clickCounter[linkNumber];
        document.getElementById("timesRequired_" + linkNumber).innerHTML = (10 - clickCounter[linkNumber]);
    }
    
    var newwindow;
    var adParams = {a: '9386380', size: '728x90'};
    var size = adParams['size'].split("x");
    function poptastic(url){
        var params = [
                    'height='+size[0],
                    'width='+size[1],
                    'fullscreen=no' // only works in IE, but here for completeness
                    ].join(',');
        newwindow=window.open(url,'name',params);
        if (window.focus) {newwindow.focus()}
    }
    

    jsfiddle

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

Sidebar

Related Questions

Does anybody know how can I determine where the user clicked in a DataGrid
Use case: User clicks a link, a modal window is displayed containing one big
How can I know what date format user prefers? Is there a way to
How can I know, by using C++ code, which user runs a specific service?
I know I can use something like User.sort {|a, b| a.attribute <=> b.attribute} or
Is there a way I can piggy back sessions to know if the user
Does anyone know how I can show a tooltip whenever a user hovers over
I have a text area where user can write his SMS. You all know
Does anybody know, is it possible and how can I get name of user
Is it possible to block a page when a user clicks on a link

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.