title: Should I find a way to programmatically insert an ID into html
body: <p>I came across an issue recently where I wanted to manipulate the text of a span tag. I do not know much about dom, but since the element wanted to manipulate it didn't have an ID, and only was a span tag, I decided to inspect element the webpage, and add in and id.</p>
  
  <p>for example</p>
  
  <pre><code>&lt;span&gt;some random text&lt;/span&gt;
  
  &lt;span id="newID"&gt;some random text with an id&lt;/span&gt;
  </code></pre>
  
  <p>Now, i can use dom to manipulate it</p>
  
  <pre><code>document.getElementById("newID").textContent="newtext";
  </code></pre>
  
  <p>Is there a way to give an element an ID without inspecting element, or is there a better way to do it, such as getting the element by tagname and figuring out which number in the array it is somehow. </p>
  
  <p>Another question I have is if anyone has a webscraping tool used for finding element names, id's, values, etc. This is an example of one, but is only supported in internet explore, which doesnt support many websites. <a href="http://the-automator.com/download/iWB2_Learner.exe" rel="nofollow noreferrer">iwb2learnertool</a></p>