Autor Zpráva
Cecil
Profil *
<style>
#1 { background-color: red; }
#2 { background-color: green; }
.1 { background-color: red; }
.2 { background-color: green; }
</style>
<input type="text" size="15" value="AHOJ" maxlength="15" id="1" onfocus="if(this.value=='AHOJ') this.id='2'" >
<input type="text" size="15" value="AHOJ" maxlength="15" class="1" onfocus="if(this.value=='AHOJ') this.class='2'" >

Jak to napsat aby to fungovalo i pro class ? Popripade pres PHP ?
habendorf
Profil
this.className

A podívej se, jaká pravidla platí pro názvy id a class (např. nesmí začínat číslicí).
ah01
Profil
class je rezervované slovo, použít className místo class
Cecil
Profil *
Deka, jako dik
Toto téma je uzamčeno. Odpověď nelze zaslat.

0