# not adding ()'s to function calls?

**URL:** <https://forum.kirupa.com/t/not-adding-s-to-function-calls/639827>\
**Category:** web dev\
**Created:** [May 17, 2019, 4:10pm UTC](https://forum.kirupa.com/t/not-adding-s-to-function-calls/639827 "2019-05-17T16:10:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Raph59](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@Raph59](https://forum.kirupa.com/u/Raph59)\
**Post date:** [May 17, 2019, 4:10pm UTC](https://forum.kirupa.com/t/not-adding-s-to-function-calls/639827/1 "2019-05-17T16:10:35Z")

</div>

I have a different book saying this will work

```
window.onload = init;
function init() {
   var button = document.getElementById("addButton");
  button.onclick = handleButtonclick;
}

function handleButtonclick() {
 alert ("Button was clicked!");
}

```

**note** notice that when the functions are _called_ (at the top), there are no ()'s . You would expect this code to NOT run properly and yet (1) it DOES; (2) adding the ()'s TO the function calls do NOT work? I just came from K’s chapter on Functions --\> _A Simple Functions_ as a sanity check, and sure enough “you function needs to be called…” sayHello(); \<–

Thoughts appreciated. Thank yoU!!

---

_[View the full topic](https://forum.kirupa.com/t/not-adding-s-to-function-calls/639827)._
