O'Reilly Forums: Ch 3. Add Song Button - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ch 3. Add Song Button

#1 User is offline   jo_eazy 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 13-March 12

Posted 13 March 2012 - 10:43 AM

Here is my js code for the Button. However I'm not getting the alert on click please advise

window.onload = init;

function init() {
var button = document.getElementById("addButton");
button.onclick = handleButtonClick;
}
function handleButtonClick(){
alert("Button was clicked!");
}
0

#2 User is offline   jo_eazy 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 13-March 12

Posted 13 March 2012 - 11:29 AM

Nvm i made an error in my html document
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users