<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1044700" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1044700</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Keep the #1 as the href</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/href-needs-two-javascript-statements#comment-1244322</link>
    <description> &lt;p&gt;Keep the #1 as the href (that is what it s really there for), and run actual javascript from the onclick attribute:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;#1&amp;quot; onclick=&amp;quot;highlightCode(&amp;#039;1&amp;#039;);&amp;quot;&amp;gt;TEXT TEXT&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you need multiple Javascript calls them selves, you can separate then with a semicolon, or create a new function that calls them both.&lt;/p&gt;
&lt;p&gt;One added feature of using the onclick, it will check to see what value is returned by the javascript call. If it gets a &quot;false&quot; value, it will not process the href portion. &lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;/regularlink.php&amp;quot; onclick=&amp;quot;return FormNotUpdated();&amp;quot;&amp;gt;TEXT TEXT&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If &quot;FormNotUpdated&quot; returns true it will follow the link, otherwise it will not go anywhere.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Aug 2009 16:06:39 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1244322 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
