473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

reading the value of the a tag with javascript

1
I published my website and it creates the code below code:

The url's are not the same, see the marked url's. If I click on the link, I go to the wrong webpage. http://en.wikipedia.org/wiki/The_Football_Association is the right url. I want make a javascript file that reads the A tags and so he can copy the right url on the A HREF.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML lang="en">
  3. <HEAD>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  5. <LINK HREF="CollapsibleList.css" REL="stylesheet" TYPE="text/css">
  6. <SCRIPT TYPE="text/javascript" SRC="CollapsibleList.js" ></SCRIPT>
  7. <TITLE>Documents Wiki Football</TITLE>
  8. <META NAME="author" CONTENT="UAU106">
  9. </HEAD>
  10. <BODY>
  11. <A NAME="Topofpagedocuments1htm"></A>
  12. <H2>Documents Wiki Football</H2>
  13. <H3>Link: <A HREF="Http://en.Wikipedia.Org/wiki/the_football_association">http://en.wikipedia.org/wiki/The_Football_Association</A></H3>
  14. <HR>
  15. <P>
  16. <A HREF="#Topofpagedocuments1htm">Go to Top of This Page</A>|
  17. <A HREF="Index.Htm">Return to the Contents Page</A><BR><SMALL>
  18. Created from the Test on 12-1-2010 at 13:41</SMALL></P>
  19. </BODY>
  20. </HTML>
Jan 12 '10 #1
2 1314
Dormilich
8,658 Expert Mod 8TB
I’d just copy the correct URL by hand into the href, otherwise you should revise the responsible script.
Jan 12 '10 #2
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. function changeLink()
  4. {
  5. document.getElementById('MyLink').href="Http://en.Wikipedia.Org/wiki/the_football_association";
  6. document.getElementById('MyLink').target="_blank";
  7. }
  8. </script>
  9.  
  10. <a id="MyLink" href="http://www.JustaLink.com" onclick="changeLink()">Just A Link</a>
Jan 20 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Eddie | last post by:
When I use JavaScript to read an element's textDecoration style, I only get one value even if there are more than one in the sytle sheet. For example if the text-decoration is defined as:...
1
by: Roger Godefroy | last post by:
Hi there... I want to read fieldvalues from out of a dynamicaly created table (php). But this has to be done by JavaScript. Every row of the table has a select-box, inputbox and a order-button....
1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
12
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same...
9
by: Mike Reed | last post by:
I must be having a "senile" day! I cannot recall, nor get to work, code to read a cookie's expiration date/time in an ASP page/VBScript. What am I missing? *** Sent via Developersdex...
6
by: Melih Onvural | last post by:
I need to execute some javascript and then read the value as part of a program that I am writing. I am currently doing something like this: import htmllib, urllib, formatter class...
1
by: waynes | last post by:
Hello group, first time here. I have question regarding reading form post variables. I have a forms processor that dynamically reads a form, for example: For x = 1 To Request.Form.count() ...
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
1
by: gracepaul | last post by:
hi all, I write a javascript for reading the registry value as follows <script language="javascript" type="text/javascript"> <!-- function ReadRegistry() { var WshShell;
8
by: LayneMitch via WebmasterKB.com | last post by:
I'm supposed to develop a page that asks info as form values and when you hit "submit" it takes you to a page that reads the values you entered into the first page and displays those values in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.