To find if there is Silverlight use this JS
function hasSilverlight() {
try {
try {
var AgControl = new ActiveXObject('AgControl.AgControl');
return (true);
}
catch (e) {
if (navigator.plugins["Silverlight Plug-In"]) {
return(true);
}
}
}
catch (e) {
return (false);
}
}
If the function returns true, then remove dom element...
var el = document.getElementById("button_id");
el.parentNode.removeChild(el);