Hi guys, I'm not very familiar with JavaScript. Is there any way of doing the following with Javascript?
var x = document;
var y = .write;
var c = x+y;
c("Hello World!");
|
|
function setcolor(inputobj, inputstyle, colour) {
inputobj+inputstyle = colour;
}
---
James Sleeman
I sell lots of stuff for electronic enthusiasts...
nate: The eval() function
sleemanj:
Use the associative array syntac for object referencing.
function setcolor(inputobj, property, colour) {
inputobj.style[property] = colour;
}
setcolor(document.getElementById('something'), 'backgroundColor', '#EFEFEf');
|
|