Question [Q] get output of javascript code in android

I have this javascript code

<html>

<head>
<script>
for(i=0;i<6;i++)
{
document.write("my number is "+ i );
}
</script>

</head>

</html>


I want to take the output of this javascript code and save in String in android.
like this:
my number is 0my number is 1my number is 2my number is 3my number is 4my number is 5

how can i do this in android,
please help me, i have googled it alot but didnt find any solution.