I am using OpenLayers 2.1.3 and using OpenLayers I obtain the GetFeatureInfo result but it is a web page, I want to get the output fields into a variable so I can display them in grid.
Can you update your version of Geoserver? Newer (2.4+) versions of Geoserver support JSON Natively for the response from the getFeatureInfo operation.
If you can't update you have two options:
Request for the output in GML and then parse the result in your Client code.
Otherwise, you can use this 'hack' to get the response in JSON.
Once you have the results in your client code, you can then create an array and add the values to it.