In JavaScript, object.property
is always the same thing as object['property']
, so:
document[x].src
but it's poor practice to access page elements directly off document
(and it may fail in some browser modes). Prefer to use document.getElementById(x)
(and ensure you are using id="refugeelive"
and not ancient name="refugeelive"
).