Reputation: 67
<div id="right-side-panel">
<span>UserName:<br />
<input id="txtUserName" type="text" />
</span>
<br />
<span>Password:<br />
<input id="txtPassword" type="password" />
</span>
<br />
<input id="btnLogin" type="button" value="Login" />
</div>
How can I reach this txtUserName from css file? I want to change textBox's things.
#right-side-panel
.. then?
Thanks in advance
Upvotes: 0
Views: 483
Reputation: 2904
for example:
in css
#txtUserName {
color:black;
}
in jQuery
$('#txtUserName').css('color', 'black');
Upvotes: 0
Reputation: 21292
The W3C defines IDs as "a unique identifiers to an element", so you just need #txtUserName
in order to match that <input>
.
Upvotes: 1