<input type="button" value="open" onclick="cll(document.getElementById('rew'))" />
function cll(form) {
if (form.style.display == "none") {
form.style.display = "block";
} else {
form.style.display = "none";
}
}
<input type="button" value="open" onclick="(this.value=='open') ? this.value='close' : this.value='open'" />