I was using the Firebug and FireFinder add-ons to know the XPath for knowing the locators in Selenium. CSS code also can be checked using FireFinder. When I am searching for a some kind of add-on that can offer this in Firefox, I found FireQuery doing that.
Here are the steps to get that working.
1. Install Firebug add-on
2. Install FireQuery add-on.
3. Activate the Firebug for the webpage and go to the console.
4. If the webpage doesnt have the jQuery.js added, you need to jQuerify the page.
5. Run the needed jQuery code in the console as you do for the JS.
Easy and simple. Thanks for Binaryage who developed this addon.