ho capito finalmente, anche se non mi è chiaro il perchè nel valore non posso metterci solo href....
sicuramente ci sarà un motivo ma siccome javascript non riesco mai a capirlo al 100%, va bene così
grazie Andrea, mi hai dato una grande mano
codice:<!DOCTYPE html> <html> <head> </head> <body> <a class="obclass3" href="http://www.link3.html"></a> <a class="obclass2" href="http://www.link2.html"></a> <a class="obclass1" href="http://www.link1.html"></a> <a id="object" class="obclass0" href="http://www.link0.html"></a> <button onclick="toggle()"><h3>clicca</h3></button> <style> .obclass0{ width:300px; height:300px; background-image: url(); background-color: rgb(0, 0, 0); background-repeat: no-repeat; background-attachment: scroll; position:absolute; } .obclass1{ width:300px; height:300px; background-image: url(); background-color: rgb(141, 14, 14); background-repeat: no-repeat; background-attachment: scroll; position:absolute; } .obclass2{ width:300px; height:300px; background-image: url(); background-color: rgb(43, 141, 14); background-repeat: no-repeat; background-attachment: scroll; position:absolute; } .obclass3{ width:300px; height:300px; background-image: url(); background-color: rgb(42, 62, 150); background-repeat: no-repeat; background-attachment: scroll; position:absolute; } button{ top:310px; position:absolute; } </style> <script> function toggle() { var object=document.getElementById("object"); if (object.className=="obclass0"){ object.className="obclass1", object.href="http://www.link1.html"} else if (object.className=="obclass1"){ object.className="obclass2", object.href="http://www.link2.html"} else if (object.className=="obclass2"){ object.className="obclass3", object.href="http://www.link3.html"} else if (object.className=="obclass3"){ object.className="obclass0", object.href="http://www.link0.html"} } </script> </body> </html>



Rispondi quotando