Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q988 How can I pass the selected links text property as a parameter of the links href property?

irt.org | Knowledge Base | JavaScript | Link | Q988 [ previous next ]

Q988 How can I pass the selected links text property as a parameter of the links href property?

In Netscape Navigator 4+ you can retrieve the links text property, in Internet Explorer 4 you can retrieve the links text using the innerText property:

<script language="JavaScript"><!--
function retrieveText(what) {
    if (document.layers) {
        what.href = url + '?' + escape(what.text);
    else if (document.all) {
        what.href = url + '?' + escape(what.innerText);
    else
        what.href = url;
}
//--></script>

<a href="nextpage.htm" onClick="retrieveText('nextpage.htm',this)">some text</a>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.