Mercurial > repos > davidvanzessen > imgt_immunerepertoire_igg
diff script.js @ 3:8b026af4b298 draft default tip
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 11 Mar 2014 10:39:04 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/script.js Tue Mar 11 10:39:04 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 + "')"); +}