title: how to call javaScript function from div
body: <p>hello does anybody know how to call a JavaScript function from a div?
  my div and function look like this:</p>
  
  <pre><code>@foreach(var c in Model.matrix.Cells)
  {
      &lt;tr&gt;
       &lt;td class="tdHouse" &gt;
          &lt;div onload="styleCell(event)" class="cell" id="styleCell" ondrop="drop(event,@c.row,@c.column)" ondragover="allowDrop(event)" alt="one"&gt;                                                                
          &lt;/div&gt;   
              &lt;label hidden id="@c.room.Id" class="existRoomStyle" ondragstart="drag(event)" onmouseup="dragMouseUp(event)" title="@c.room.roomName"  style= "background-color:@c.room.color"&gt; @c.room.roomName&lt;/label&gt;                                  
              &lt;img  hidden id="@c.socket.Id" alt="existSocket" class="existSocketStyle" src="~/Images/socket.jpg"  draggable="true" ondragstart="drag(event)" onmouseup="dragMouseUp(event)" title="socket" alt="one"/&gt;                                       
              &lt;img  hidden id="@c.socket.machine.Id"class="existMachineStyle" src="~/Images/MachineImages/@c.socket.machine.Image" draggable="true" ondragstart="drag(event)" title="machine" alt="one"/&gt;                                      
  
       &lt;/td&gt;
     &lt;/tr&gt;                        
    }
  
  &lt;script&gt;
  function styleCell(ev) {
      ev.target.children[0].appendChild(document.getElementById("existRoomStyle"));
      ev.target.children[0].appendChild(document.getElementById("existSocketStyle"));
      ev.target.children[0].appendChild(document.getElementById("existMachineStyle"));
   }
  &lt;/script&gt;
  </code></pre>