Friday, October 21, 2011

Manipulating the Target Window

How do you use the eValid DOM manipulation commands to modify an anchor-tag's attributes to deliver the page to a different specified new window than the one given in the HTML passage.

In this typical HTML passage if you click on the link the new page is opened in a new window named "NEW-WINDOW":


<A HREF=../URL TARGET=NEW-WINDOW>Title Of Page</A>

The key to modifying this link target dynamically is to recognize that any anchor tag that has a specified target will have the name of the target stored as one of the attributes in the defining DOM element. All you need to do is find the right element, and then put in a new string for the target page.


Here is the link to the solution description: Change the Target of an Anchor Tag Link To A New Window

No comments: