After a long long time I am posting a query
The source code generated for both scenario is given below. The only difference is extra text 'PN=".IDDescription"' in the source code. Not sure what is causing the issue. Need your kind help. I am able to access the field in both the scenarios. Able to get the field name as well. But I am not able to get an updated property value.
I also figured out that if I pass 'this' variable in function parameters then I am able to access the updated element value in my java script.
Without hiding the property:
With initially hiding the property and then being displayed:
The java script source code to access the element: