onload I call a function to change a 1, 2, or 3 to text based on that number. The divs with this name are created dynamically in a gridview so I have to use getElementsByName which I haven’t used up until this point but it seems easy enough.
I’m getting no errors in my firefox error console but my innerHTML is not changing. Does someone see the issue in this code?
*SOLVED
[code] <script type=”text/javascript” language=”javascript”>
function changeAction() {
var array1 = document.getElementsByName(“actionID”);
var count = array1.length;
window.alert(count);
for (var i = 0; i < count; i++) {
if (document.getElementsByName(“actionID”).item(i) == 1) {
document.getElementsByName(“actionID”).item(i).innerHTML = “Payment”;
} else if (document.getElementsByName(“actionID”).item(i) == 2) {
document.getElementsByName(“actionID”).item(i).innerHTML = “Auto Refund”;
} else if (document.getElementsByName(“actionID”).item(i) == 3) {
document.getElementsByName(“actionID”).item(i).innerHTML = “Admin Refund”;
}
}
}
</script>
*EDIT
Oh yea, that window.alert is displaying the proper amount of elements found too.