HighDots Forums  

Re: Modifying A tag onclick events dynamically - am I crazy

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Modifying A tag onclick events dynamically - am I crazy in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RobG
 
Posts: n/a

Default Re: Modifying A tag onclick events dynamically - am I crazy - 08-04-2006 , 08:39 PM







RobG wrote:

[...]
Quote:
It is also invalid HTML to put an A element inside a FONT element.
Ooops, not it's not - I got a bit over-zealous there! :-)


--
Rob



Reply With Quote
  #2  
Old   
GaryB
 
Posts: n/a

Default Re: Modifying A tag onclick events dynamically - am I crazy - 08-06-2006 , 02:32 AM






Thanks very much, Guys - used something from each of your comments.

The only thing I'm not sure of, Rob, is how to "...test if 'doc' is one
of the class names, rather than the only class name...".

Thanks very much.

Regards

Gary


Reply With Quote
  #3  
Old   
RobG
 
Posts: n/a

Default Re: Modifying A tag onclick events dynamically - am I crazy - 08-06-2006 , 05:53 AM



GaryB wrote:
Quote:
Thanks very much, Guys - used something from each of your comments.

The only thing I'm not sure of, Rob, is how to "...test if 'doc' is one
of the class names, rather than the only class name...".
The usual trick is to test it with a regular expression, e.g. to test if
someElement's className attribute contains the class name 'someClass' as
a single word (i.e. delimited by word breaks):

var classTest = new RegExp('\\bsomeClass\\b');

if ( someEl.className && classTest.test(someEl.className))
{
/* The element's className contains someClass as a word */
}


--
Rob


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.