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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:42:49+00:00 2026-06-11T08:42:49+00:00

Is it possible to trigger the javascript function of an anchor tag during page

  • 0

Is it possible to trigger the javascript function of an anchor tag during page load?

Here is my fiddle

<a  id="WebTree" href="javascript:alert('testing')">click me</a>


$(document).ready(function(){
    $('#WebTree').trigger('click');
    //$('#WebTree').click();
    // after the page load I'm expecting to see the alert but it's not working
});

I’m expecting to see an alert after the page is loaded but I’m not

EDIT

Ok here’s simple explanation why I’m asking this question.

Here is the original link which was dynamically generated by sharepoint.

<A id=ctl00_PlaceHolderLeftNavBar_ctl01_WebTreeViewn1 href="javascript:TreeView_PopulateNode(ctl00_PlaceHolderLeftNavBar_ctl01_WebTreeView_Data,1,ctl00_PlaceHolderLeftNavBar_ctl01_WebTreeViewn1,ctl00_PlaceHolderLeftNavBar_ctl01_WebTreeViewt1,ctl00_PlaceHolderLeftNavBar_ctl01_WebTreeViewt1i,' ','TaxonomyMetadata','Pages\\TaxonomyMetadata','t','30:FieldNameNode:e305128c-217b-47b4-81b9-db0c1e59f98f:3b529925-3610-485a-9133-bc958f7ab28e:dbf365da-565b-41ca-966d-f9bf29d9b2cf:30|ListNode|e305128c-217b-47b4-81b9-db0c1e59f98f|3b529925-3610-485a-9133-bc958f7ab28e|ea06a686-46c5-4470-a1ab-4fe4341589c8','tt')">

    <IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" alt="Expand TaxonomyMetadata" src="/_layouts/images/MDNCollapsed.png">
</A>

Bottom line I have no control of the anchor tag.

  • 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-11T08:42:50+00:00Added an answer on June 11, 2026 at 8:42 am

    How about:

    $(document).ready() {
        var code = $('#WebTree').attr('href');
        eval(code);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to trigger javascript alert using PHP. Is it possible I want to
Is it possible to trigger Browser's zoom-in and zoom-out function through JavaScript? I want
Possible Duplicate: Reset JavaScript Counter? I'm trying to create a function that will trigger
Is it possible to trigger a JavaScript function when a user tries to reload
Possible Duplicate: How do you trigger javascript functions from flash? Possible Duplicate: How do
Is it possible to trigger copy event from JavaScript/jQuery? I want to simulate copy
Is it possible to trigger for example flash uploading button via javascript? For example
Possible Duplicate: How to execute a JavaScript function when I have its name as
Possible Duplicate: Kill Ajax requests using JavaScript using jQuery Here is the simple code
In javascript is it possible to trigger an action when a element (for example

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.