Author Topic: Which event to use for adding elements  (Read 4855 times)

Offline pratik_1712

  • Jr. Member
  • **
  • Posts: 43
Which event to use for adding elements
« on: February 07, 2011, 06:53:03 AM »
I want to add the following code to the compose window..

I am not sure which JavaScript event to bind it to..

Code: [Select]

var row = document.createElement('tr');
td1 = document.createElement('td');
td1.innerHTML = 'Priority';
td1.setAttribute('title', 'priority');
                td1.setAttribute('class', 'title');
             
row.appendChild(td1);

td2 = document.createElement('td');
td2.setAttribute('class', 'editfield');
               
                inp = document.createElement('input');
                inp.setAttribute('type', 'text');
                inp.setAttribute('id', 'compose-priority');

                td2.appendChild(inp);

row.appendChild(td2);
document.getElementById('compose-headers').lastChild.appendChild(row);