Displaying 1 result from an estimated 1 matches for "opencontact".
Did you mean:
openconnect
2008 Jul 01
5
Attaching event observers to a series of elements - best practice?
...quot;, lastName: "Johnson" },
{ id: 3, firstName: "Tim", lastName: "Horton" }
];
I''d like to iterate over this array, create an <li> for each contact,
and—here''s the tricky part—attach an onclick observer to each <li>,
which calls the openContact() function and passes in the ID of the
contact that was clicked.
I understand closures. However, I haven''t found an elegant way to
solve the problem. This won''t work:
function populateContactsList( contacts )
var theUL = document.getElementById("addr-book-index");...