Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since you don't have an ID on the link - there is really no way to distinguish it from a similar <code>&lt;a&gt;</code> element (other than compare the contents - which I would advise against).</p> <p>If you know that there is only one <code>&lt;a&gt;</code> element - you can get the <code>href</code> value and do with it as you please (I print it to the console, as an example):</p> <pre><code>var aEl = document.getElementsByTagName('a'); console.log(aEl[0].href); </code></pre> <p>Note that <code>getElementsByTagName</code> returns an array of elements (or rather a <code>NodeList</code> - but let's leave it out for this purpose) and its support in Opera and Safari (IIRC) is iffy.</p> <p>Alternatively (and preferably) - add an ID to your <code>&lt;a&gt;</code> elements if you can:</p> <pre><code>&lt;a id='someID' href="JavaScript:article('40')"&gt;What is the difference between Archiving and Trashing an Article? &lt;/a&gt; </code></pre> <p>and use the following to get the <code>href</code>:</p> <pre><code>var aEl = document.getElementById('someID'); console.log(aEl.href); </code></pre> <p><strong>EDIT</strong></p> <p>after some thought - and in case your intent was to keep the value the <code>article</code> function returns, then you should consider takign the function invocation out of the <code>&lt;a&gt;</code> element and calling it during/after DOM rendering, keeping the result, but also inserting it into the <code>&lt;a&gt;</code> element through the same <code>href</code> attribute.</p> <p>Otherwise you'd have (AFAIK) to resort to shady techniques that I don't even mention here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload