Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Link | Q988 [ previous next ]

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>

©2018 Martin Webb