Hi nauna,
Please take refernce to the below code and correct your code.
HTML
<div>
Name:
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:DropDownList ID="ddlFruits" runat="server">
<asp:ListItem Text="Select" Value="0" />
<asp:ListItem Text="Mango" Value="Mango" />
</asp:DropDownList>
<a href="" id="anchorVisible">Link</a>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="return VisiblilityCheck();" />
</div>
<script type="text/javascript">
function VisiblilityCheck() {
var name = document.getElementById('<%=txtName.ClientID%>').value;
var dropdownselectedIndex = document.getElementById('<%=ddlFruits.ClientID%>').selectedIndex;
var fruit = document.getElementById('<%=ddlFruits.ClientID%>').options[dropdownselectedIndex].value;
// You can check with DropDownList SelectedIndex or SelectedValue.
if (name == '' && dropdownselectedIndex == 0) {
document.getElementById('anchorVisible').style.visibility = 'hidden';
return false;
}
}
</script>
Screenshot