view 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 source

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 + "')");
}