I know its possible, but I haven't been able to get a hold of how to send the parameter as an array or string?
is what I have right now and it will work as long as the element is a single string.Code:function updateHours(el, val) { if(el!=null && val!=null) { var element = document.getElementById(el); element.innerHTML = element.value + val; } }
to make this robust, I want to be able to insert an array into both parameters or just 1 parameter... so it would update accordingly
would update 3 elements taking into account the appropriate 3 values andCode:function updateHours("['el1','el2','el3']", "['val1','val2','val3']") { }
would update all 3 elements taking into account only 1 value.Code:function updateHours("['el1','el2','el3']", "val") { }
would update 1 element with an assortment of valuesCode:function updateHours("el", "['val1','val2','val3']") { }


Reply With Quote

Bookmarks