I have the following jQuery code. It is writing two event listeners like this ok? The following code throws an.error
$(document).ready(function () {
$('tr').hover(
function () {
$(this).css('background-color', '#FFFF99');
$(this).contents('td').css({
'border': '1px solid red',
'border-left': 'none',
'border-right': 'none'
});
$(this).contents('td:first').css('border-left', '1px solid red');
$(this).contents('td:last').css('border-right', '1px solid red');
});
$('#radioButtonImageSourceContainerId input:radio').click(function () {
if ($(this).val() === 'fromFile') {
addVisibility("from-file");
removeVisibility("from-url");
}
else if ($(this).val() === 'fromUrl') {
removeVisibility("from-file");
addVisibility("from-url");
}
})
});
The other 2 functions are
function addVisibility(elemId) {
document.getElementById(elemId).style.display = "";
if (document.getElementById(elemId).style.visibility == "hidden") {
document.getElementById(elemId).style.visibility = "visible";
}
}
function removeVisibility(elemId) {
document.getElementById(elemId).style.display = "";
if (document.getElementById(elemId).style.visibility == "visible") {
document.getElementById(elemId).style.visibility = "hidden";
}
}