Codice PHP:
<html>
<head>
<style type="text/css">
.on {
color:red;
}
.off {
color:green;
}
.default{
color:blue;
}
</style>
<script type="application/javascript">
window.onload = function(){
var mylink = document.getElementById('mylink');
mylink.onclick = function(){
var clickClass = this.className;
var currentClass = ( clickClass === 'default' || clickClass === 'off')?'on':'off';
this.className = currentClass;
return false;
}
}
</script>
</head>
<body>
[url="#"] mylink[/url]
</body>
</html>
![]()