staffbuttons+="<div class='buttonred' onclick=\"call("+this+",'"+staffinfo[k]["extension"]+"')\" style='background-color:darkblue;border-color: #eaeaff;' >call</div>"
//then i set the innerHTML of some other element
//and here is the call() function:
function call(callbutton,extension){
callbutton.value="xfer"
alert("callbutton is "+callbutton)
callbutton.style.backgroundColor="pink"
callbutton.setAttribute("onClick()","transfer("+callbutton+",'"+extension+"'")
}
//but the alert box shows it has no value