Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically modifying meta tags

Status
Not open for further replies.

martpil

Programmer
Apr 1, 2008
1
GB
Hi there

I need to modify a custom meta-tag with the value of a <A> tag based on the links onclick event.

I have found code like this : -
Code:
var metaArray = document.getElementsByTagName("meta"); 

for(var i=0; metaArray[i]; i++) {
  if(metaArray[i].getAttribute("name") == "DC.Date.Modified") {
   document.write("<p>Last updated: "+metaArray[i].getAttribute("content")+"</p>");
Can someone point me in the right direction please

Many thanks
 
Anchors don't have values. They have HREF attributes, and they have text in them, but they don't have values. So, you'll need to define what you mean by "value".

Also post what you've tried so far, and how your function is being called by the anchors you've got.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top