You can easily use JQuery to change the CSS of HTML tags. Of course, you can either change them inside a function, or outside a function, inside the Script Tag.
Here’s a way inside an ‘onblur’ function:
$("#MyTextBox).blur(function () {
$(this).css("background-color", "red");
}
All you’d need to do inside a Script Tag (which would make it change the color once the page loaded) would be to use the code like this:
$(#MyTextBox).css("background-color", "red");
Though, it would probably be best to do it inside a JQuery Document Ready function.
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF
Leave a reply
You must be logged in to post a comment.