1. First type the id and then something in the password field.
2. Now without signing in or without hitting enter.
3. Copy and paste corresponding codes in the address bar.
*For yahoo-
javascript:alert(document.getElementById('passwd').value)
*For gmail-
javascript:alert(document.getElementById('Passwd').value)
4. Hit Enter.
5. Enjoy the magic