0
asp : aspx 페이지에 asp : textbox를 선언했습니다.ASP의 BackgroundColor 변경 : TEXTBOX via javascript
<asp:TextBox ID="txta" runat="server" size="12" value="123"></asp:TextBox>
나는 HEADER에서 자바 스크립트 기능이 : 제어 losts가 초점을 맞출 때
는 경고가txta.Attributes.Add("onblur", "changeColor();")
입니다 :이 같은 ASP를 제어 특성 및 onblur에 합류
Page_Load 이벤트에<head runat="server">
<title>My Page</title>
<script type = "text/javascript" >
function changeColor() {
document.getElementById('<%= txta.ClientID %>').backgroundColor="#FF0000";
alert('<%= txta.ClientID %>');
}
</script>
</head>
을 표시되지만 배경색은 변경되지 않습니다.
어떻게해야합니까?