title: How can I have my google chrome extension pick out a certain part of the current website's HTML?
body: <p>I have been working on a project that will have my google chrome extension sign in for me. I have the first part done, but now I would like it to sign in for me in yahoo as well as gmail. The slight problem is that the id's of the textboxes for both yahoo and gmail are NOT the same. Let me show you:</p>
  
  <p>This is my code that will enter in the username and  password mainly:</p>
  
  <pre><code>`var usernameID='login-username';
  var passwordID='login-passwd';
  var username= 'askingaquestion@email.com';
  var password='iloveit';
  document.getElementById(usernameID).value= username;
  document.getElementById(passwordID).value= password; `  
  </code></pre>
  
  <p>As you can see, in the first two lines, it says, <code>var = usernameID</code> which is the username textbox html id, and the <code>var = passwordID</code> is for the password box's id. This code only fills in my information for Yahoo. See if I take a snippet out of the yahoo login in page html it says:</p>
  
  <pre><code>`id="login-username"` and `id="login-passwd"`
  </code></pre>
  
  <p>for username and ID. Now if I go to GMail and I look for those same things, I get this:</p>
  
  <p><code>id="Email"</code> that would be the usernameID and <code>id="Passwd"</code> would be the passwordID. See how they are different? I was wondering if there was a way to have my chrome extension search for both the ID's of the username textbox and of the password textbox, and set <code>var=usernameID</code> to the username ID found in the page's html, and set <code>var=passwordID</code> to the password ID found in the page's html. Please tell me if you need me to post any more of my previous work, but this piece of code was the only source of problem. Thank you very much in advance.</p>