I am trying to call a javascript function which will set forecolor and backcolor of a control when the control is loaded
But this function is not raising.
<ItemTemplate>
<div onload= "invertColor(this,'<%# Eval("ColorCode") %>')">
<%# Eval("ColorCode") %>
</div>
</ItemTemplate>
Here is my javascript
function invertColor(sender, backColor) {
alert('hi');
// alert(backColor.toString());
// if (backColor != '') {
//
// sender.css('background-color', backColor);
// backColor= backColor.substr(1, 6);
// foreColor = numberToHex(255 - parseInt(backColor.substr(0, 2), 16))
// + numberToHex(255 - parseInt(backColor.substr(2, 2), 16))
// + numberToHex(255 - parseInt(backColor.substr(4, 2), 16));
// sender.css('color', "#"+foreColor)
// }
}