comparison script.js @ 5:be7ed742f870 draft default tip

Uploaded
author davidvanzessen
date Tue, 11 Mar 2014 11:10:30 -0400
parents
children
comparison
equal deleted inserted replaced
4:2f2544607ad6 5:be7ed742f870
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 }