<p style="font: weight: bold">This is an introductory paragraph.</p>
<p class="introduction">This is an introductory paragraph.</p>
p.introduction { font-weight: bold; }
<a href="javascript:window.open('help.html')">my help page</a>
<a href="#" onclick="window.open('help.html')">my help page</a>
<a href="help.html"
onclick="window.open(this.getAttribute("href")); return false;">my help page</a>
<a href="help.html" class="help">my help page</a>
function doPopups() {
var links = document.getElementsByTagName("a");
for (var i=0; i < links.length; i++) {
if (links[i].className.match("help")) {
links[i].onclick = function() {
window.open(this.getAttribute("href"));
return false;
};
}
}
}
function doPopups() {
if (document.getElementsByTagName) {
var links = document.getElementsByTagName("a");
for (var i=0; i < links.length; i++) {
if (links[i].className.match("help")) {
links[i].onclick = function() {
window.open(this.getAttribute("href"));
return false;
};
}
}
}
}
function doPopups() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
for (var i=0; i < links.length; i++) {
if (links[i].className.match("help")) {
links[i].onclick = function() {
window.open(this.getAttribute("href"));
return false;
};
}
}
}
<script type="text/javascript" src="file.js"></script>
doPopups();
window.onload = doPopups;
addLoadEvent
from Simon Willison: addLoadEvent(doPopups);
Applying Progressive Enhancement to Ajax: Hijax