
| | |||||||
| Website Development HTML, traffic, hosting, and more... this is the forum for every webmaster. |
Register Now for FREE! | |||||
| |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Need help here guys. In my site I'm using XHTML 1.0 Strict with CSS. My pages Validate (W3C) fine, except for one thing: I need to add two elements in one tag/string, and not sure what is the correct syntax to seperate the items, while keeping them within the same tag. This is a string sample: Code: <a href="http://www.example.com/files/map.pdf" onclick="javascript:urchinTracker ('/downloads/map'); "> Code: onclick="window.open(this.href); return false" ================================================== ======================= RESOLVED I have found a resolution to my question below. In XHTML many HTML elements have been depreciated. Inserting styles in Strict has been more challenging, yet offering greater control. One work-around to the problem, in long form, is to add a second line containing the second 'onclick' attribute. However, the proper, and more shorter way is to add a semi-colon between the attributes, with the onclick=javascript attribute first, followed by the second. This is the long way (but does work) in two seperate strings, Code: <li><a href="http://www.antivirus.comodo.com/" onclick="window.open(this.href); return false">Comodo Anti-Virus</a> Free life-time license (very good) | 34.4 MB
<a href="http://www.antivirus.comodo.com/" onclick="javascript:urchinTracker('/security_apps/Comodo_Anti-Virus');"></a></li> Code: <li><a href="http://free.grisoft.com/freeweb.php/doc/5390/lng/us/tpl/v5#avg-anti-virus-free" onclick="javascript:urchinTracker('/security_apps/AVG_Anti-Virus'); window.open(this.href); return false">AVG Anti-Virus</a> by Grisoft (very good software) | 20.4 MB</li> Last edited by Tom; 06-11-2007 at 12:19 AM. |
| Sponsored Links | ||
| |