When you set the Visible property of a server side control to false it not even rendered to the client, so your code will not found it at all (b will be null)...
If you want to make it visible/invisible on the client you have to play with client side attributes...
Set display or clear the display attribute...
<asp:label id="lblWarning" runat="server" forecolor="Red" height="19px" width="276px" xmlns:asp="#unknown"></asp:label>
function ChangeProperty() {
var b = document.getElementById('<%=lblWarning.ClientID%>');
if (b!=null)
{
if(b.style.display == "none")
{
b.style.display = "";
}
else
{
b.style.display = "none";
}
}
}