title: Inline onclick with two function calls
body: <p>I have a place in my code that appends a bunch of other divs to one parent div. Inside each of these divs there is an image (being used as a button) that when clicked needs to call two functions.
   this would normally be done: </p>
  
  <pre><code> onclick = "alert('hi'); addfriend(username);";
  </code></pre>
  
  <p>but since im appending them Im doing the onclick function in the inline code that im appending see here:</p>
  
  <pre><code>.append("&lt;div class = 'scrollable'; style = 'width:100%; height: 30%; text-align: left; background-color: white; border: 1px solid gray; line-height: 0%' &gt;" +
       "&lt;div style = 'float: left; margin-left: 5%'&gt;&lt;p style = ' font-size:" +fontSize+"'&gt;" + username + "&lt;/p&gt;&lt;p style = 'color: gray; font-size:" +subtext+"'&gt;" +wholeName+"&lt;/p&gt;&lt;/div&gt;    **&lt;img style = 'float: right; padding-top: 3%; padding-right: 3%; right: 0; height: 80%;' onclick = 'addFriend('"+username+"'); alert('hi')'  src = 'addfriend.png'&gt;**&lt;/div&gt;");
  </code></pre>
  
  <p>I know it looks like a mess and that you shouldnt use inline but if its possible thats what I want to do.</p>
  
  <p>Anyway since its inline I tried to wrap both of the onclick functions in ' ' instead of " " but that doesnt let it read both functions for some reason. Any idea how to fix?</p>