<form action=""> <p><input type="button" value="Проверить" onclick="element.setAttribute("block1", "block2")"></p> </form>