Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Javascript related question

Javascript related question

Scheduled Pinned Locked Moved Web Development
tutorialjavascripthelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tina P
    wrote on last edited by
    #1

    Hello All, I need to be able to set an href property of an anchor tag to a javascript i.e. <code> <a id="blah" href='this is where i've been told to have Javascript'"</code> This javascript is suppose to mimick a mouse click event. Can someone show me an example of how to go about doing that. I have barely used Javascript and not too familiar with it. Any help would be higly appreciated. Thanks ~tina

    R 1 Reply Last reply
    0
    • T Tina P

      Hello All, I need to be able to set an href property of an anchor tag to a javascript i.e. <code> <a id="blah" href='this is where i've been told to have Javascript'"</code> This javascript is suppose to mimick a mouse click event. Can someone show me an example of how to go about doing that. I have barely used Javascript and not too familiar with it. Any help would be higly appreciated. Thanks ~tina

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #2

      You could use something along the lines of:

      <a href="javascript:ClickMe();">Click Me</a>

      funtion ClickMe() {
      alert('I got clicked!');
      }

      me, me, me

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups