<form action=""> <p><input type="button" value="Проверить" onclick="this.className ='block2';alert([this.value,this.className])"></p> </form>