[Javascript] Something better than getElementById

Troy III Ajnej trojani2000 at hotmail.com
Sat Oct 22 23:08:42 CDT 2005


Sorry, but something like that is possible and still working only in IEssss. 
The document.getUgly('byW3C.happyforIt') is the 'standard' for now.

-sorry if my post look's ugly, its because I've just installed the firefox, 
sort of W3C standard!

<html><DIV>
<P align=center>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR>Troy 
III<BR>progressive art 
enterprise<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</P></DIV></html>


<BLOCKQUOTE style='PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #A0C6E5 
2px solid; MARGIN-RIGHT: 0px'><font 
style='FONT-SIZE:11px;FONT-FAMILY:tahoma,sans-serif'><hr color=#A0C6E5 
size=1>
From:  <i>Terry Riegel &lt;riegel at clearimageonline.com&gt;</i><br>Reply-To:  
<i>&quot;\[JavaScript List\]&quot; &lt;javascript at LaTech.edu&gt;</i><br>To:  
<i>&quot;\[JavaScript List\]&quot; 
&lt;javascript at LaTech.edu&gt;</i><br>Subject:  <i>Re: [Javascript] Something 
better than getElementById</i><br>Date:  <i>Fri, 21 Oct 2005 20:08:12 
-0400</i><br>&gt;I have a page that uses the code pasted 
below<br>&gt;<br>&gt;---<br>&gt;      var a = 
document.getElementById(dest);<br>&gt;      a.className='sel'<br>&gt;      
document.browseform[&quot;fm_list&quot;].value = 
&quot;|&quot;+dest+b;<br>&gt;      
document.browseform[&quot;fm_cmd&quot;].value = &quot;&quot;;<br>&gt;      
document.browseformhere[&quot;fm_cmd&quot;].value = &quot;&quot;;<br>&gt;    
   document.browseformhere[&quot;fm_list&quot;].value = 
&quot;|&quot;+dest+b;<br>&gt;      
document.browseform.submit();<br>&gt;---<br>&gt;<br>&gt;<br>&gt;<br>&gt;The 
only reason I need to getElementById is to set the background  <br>&gt;color 
to indicate the link is selected. Is there a way to set an  
<br>&gt;attribute without looking up the id? I am looking for ways to speed  
<br>&gt;up my pages, some have hundred's of ID's.<br>&gt;<br>&gt;Something 
like MyParentDiv.className='sel'<br>&gt;<br>&gt;<br>&gt;<br>&gt;Here is the 
HTML<br>&gt;<br>&gt;---<br>&gt;&lt;div class=&quot;nor&quot; 
id=&quot;images&quot;&gt;<br>&gt;  &lt;a 
href=&quot;javascript:changedest2('images','DIR')&quot;&gt;&lt;img 
src=&quot;/ <br>&gt;clearimage/images/dir-small.gif&quot; 
border=&quot;0&quot; width=&quot;12&quot; height=&quot;12&quot;  
<br>&gt;align=&quot;left&quot;&gt;&lt;/a&gt;<br>&gt;  &lt;a 
href=&quot;javascript:changedest('images','DIR')&quot;  
<br>&gt;ondblclick=&quot;changedest2('images','DIR')&quot;&gt;images&lt;/a&gt;<br>&gt;&lt;/div&gt;<br>&gt;---<br>&gt;_______________________________________________<br>&gt;Javascript 
mailing 
list<br>&gt;Javascript at LaTech.edu<br>&gt;https://lists.LaTech.edu/mailman/listinfo/javascript<br></font></BLOCKQUOTE>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the Javascript mailing list