Debt Consolidation - Debt Consolidation - Submit articles - Web Advertising - Debt Consolidation

PDA

View Full Version : javascript open a function which is a value of a funtion


narfy892
Aug 27th 2008, 1:02 am
I want the value of this :
document.getElementById('clearthisok').value;
to be referred to a function knowing that I don’t know its value.

Ex:

<script>
document.getElementById('clearthisok').value="xxx01();";

//syntax that open the function xxx01()//

function xxx01()
{
Alert("it’s working")
}
</script>

xlcho
Aug 27th 2008, 1:08 am
You can use eval() (http://www.w3schools.com/jsref/jsref_eval.asp)

narfy892
Aug 27th 2008, 1:45 am
eval(document.getElementById('clearthisok').value)