Another way to do it:
Code:
if ( anchorSrc.match(/mysite.co.uk/i)
&& ( anchorVal.match(/great site/i) || anchorVal.match(/super site/i) )
) {
The /i there means "ignore case". Technically, the argument to match SHOULD be a regular expression. When you use a string instead, as Philip did, it is converted to a regular expression for you, but then you can't specify /i or /g.
Another way, even better:
Code:
if ( anchorSrc.match(/mysite.co.uk/i)
&& anchorVal.match(/(great site|super site)/i)
) {
A regular expression can be used to match any number of things if they are separated by | and grouped in ( ).
Still another way (completely equivalent for these purposes):
Code:
if ( (/mysite.co.uk/i).test(anchorSrc) && (/(great site|super site)/i).test(anchorSrc) ) {