How can we return a value from User Defined Function ? For
Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b)
and i am addding those 2 and storing in to another var (c).
Now i want to pass that var(c) to another function (fun2).
What will be the script?
Answer Posted / ganesh
<script language="javascript">
function add()
{
var a=parseInt(document.getElementById('x').value);
var b=parseInt(document.getElementById('y').value);
var c= a + b;
fun(c);
}
function fun(disp)
{
alert(disp);
}
</script>
</head>
<body>
Enter First Number:<input type="text" id="x" /><br />
Enter Second Number:<input type="text" id="y" /><br />
<input type="button" value="Add" onclick="add()" />
</body>
Am i right ??
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Someone who protect my excel file, m using ms office 2007 and windows 7 operating system, pls help me, how can i unprotect sheet
Why we use Action Script(Multimedia Flash) rather than using other scripting languages (JAVA,VB...etc) ?
why script is client dependant.
Need a batch file or VB script to delete old (more than 90datys) roaming profiles
how can i type the text message in compose box in yahoo mail using descriptive programming in QTP?
why do u need an ANT?
If we add regular expressions to a script recorded in QTP, will it effect the performance of the script?
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
I have deducted tds on pay slip for employees ist month tell me how to deposit this amt to govt. by bank or any form is available fill the same and deposit the govt. department. Pls explain me which form to be used for deposit the same with due date.
a="10.20.30.1" replace 1 with 45 in python using reg ex
how can i get two different fonts in a single line
what is the Structure of an ANT file?
how do invoke OS task through ANT?
How do you insert record into scripting using siebel crm
why script is client dependant.