title: Get id of an element that triggered the event, utilize id as string
body: <p>I want to use the triggering elements id, then use it as a string, to perform certain logical operations.</p>
  <p>Basically:</p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
   
  //OK 
  function getValue(control)
  {
  alert(control.id);
  }
  
  function filterByIDType(ctl) {  
  var marker = &quot;not set&quot;;
  var ctlID = ctl.id;
  alert(ctlID);  //OK
  //alert(ctlID.toString()); //Not working, how to use to match particular 'types'
  
  // Not working:
  try
  { 
  if(ctlID.Match('Type1'))
   { marker ='Type1'; 
     document.getElementByID(marker+'Lists').value = marker; 
  }
  if(ctlID.Match('Type2'))
    marker = 'Type2'
  if(ctlID.Match('Type3'))
    marker = 'Type3';
  
  }
  catch(err)
  {
  alert('Marker is still:'+marker);
  }
  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h1&gt;My Web Page&lt;/h1&gt;
  &lt;p id=&quot;demo&quot;&gt;This is a paragraph.&lt;/p&gt;
  
  &lt;a id=&quot;idname&quot; onclick=&quot;getValue(this)&quot;&gt;Click link, get id&lt;/a&gt;
  
  &lt;input id=&quot;Type1Lists&quot; value=&quot;&quot;&gt;input type1 here:&lt;/input&gt;
  &lt;p id=&quot;Type1Input&quot; onclick=&quot;filterByIDType(this)&quot;&gt;Click a paragraph with type1 ip&lt;/p&gt;
  
  &lt;p id=&quot;Type2Input&quot; onclick=&quot;filterByIDType(this)&quot;&gt;click a paragraph with type2 ip&lt;/p&gt;
  
  &lt;p id=&quot;Type3Input&quot; onclick=&quot;filterByIDType(this)&quot;&gt;click a paragraph with type&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  <p>I get error:</p>
  <blockquote>
  <p>Object doesn't support this property or method</p>
  </blockquote>