comparison script.js @ 5:99834201251f draft

Uploaded
author davidvanzessen
date Mon, 10 Mar 2014 11:06:17 -0400
parents
children 18ac92a69ef1
comparison
equal deleted inserted replaced
4:8803239b1770 5:99834201251f
1 function compareAdd(id){
2 var img = document.createElement('img');
3 img.setAttribute('src', 'VD_' + id + '.png');
4 var td = document.createElement('td');
5 td.setAttribute('id', "comparison_vd_" + id);
6 td.appendChild(img)
7 document.getElementById('comparison_table_vd').appendChild(td);
8
9 img = document.createElement('img');
10 img.setAttribute('src', 'VJ_' + id + '.png');
11 td = document.createElement('td');
12 td.setAttribute('id', "comparison_vj_" + id);
13 td.appendChild(img)
14 document.getElementById('comparison_table_vj').appendChild(td);
15
16 img = document.createElement('img');
17 img.setAttribute('src', 'DJ_' + id + '.png');
18 td = document.createElement('td');
19 td.setAttribute('id', "comparison_dj_" + id);
20 td.appendChild(img)
21 document.getElementById('comparison_table_dj').appendChild(td);
22
23 document.getElementById('compare_checkbox_' + id).setAttribute('onchange', "javascript:compareRemove('" + id + "')");
24 }
25
26
27 function compareRemove(id){
28 document.getElementById("comparison_vd_" + id).remove()
29 document.getElementById("comparison_vj_" + id).remove()
30 document.getElementById("comparison_dj_" + id).remove()
31 document.getElementById('compare_checkbox_' + id).setAttribute('onchange', "javascript:compareAdd('" + id + "')");
32 }