Mercurial > repos > davidvanzessen > complete_immunerepertoire_igg
diff script.js @ 0:7d97fa9a0423 draft
Uploaded
author | davidvanzessen |
---|---|
date | Fri, 09 May 2014 09:35:32 -0400 |
parents | |
children | 778a9d130904 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/script.js Fri May 09 09:35:32 2014 -0400 @@ -0,0 +1,32 @@ +function compareAdd(id){ + var img = document.createElement('img'); + img.setAttribute('src', 'VD_' + id + '.png'); + var td = document.createElement('td'); + td.setAttribute('id', "comparison_vd_" + id); + td.appendChild(img) + document.getElementById('comparison_table_vd').appendChild(td); + + img = document.createElement('img'); + img.setAttribute('src', 'VJ_' + id + '.png'); + td = document.createElement('td'); + td.setAttribute('id', "comparison_vj_" + id); + td.appendChild(img) + document.getElementById('comparison_table_vj').appendChild(td); + + img = document.createElement('img'); + img.setAttribute('src', 'DJ_' + id + '.png'); + td = document.createElement('td'); + td.setAttribute('id', "comparison_dj_" + id); + td.appendChild(img) + document.getElementById('comparison_table_dj').appendChild(td); + + document.getElementById('compare_checkbox_' + id).setAttribute('onchange', "javascript:compareRemove('" + id + "')"); +} + + +function compareRemove(id){ + document.getElementById("comparison_vd_" + id).remove() + document.getElementById("comparison_vj_" + id).remove() + document.getElementById("comparison_dj_" + id).remove() + document.getElementById('compare_checkbox_' + id).setAttribute('onchange', "javascript:compareAdd('" + id + "')"); +}