//if you want to set string at function use this way
document.getElementById("btn").setAttribute('onclick',"hideList()");
//if you want set function variable then
document.getElementById("btn").onclick=hideList;
Обновление:
//This will set the method to a string
document.getElementById("btn").onclick="hideList()";