This makes no sense:
http://page-test.co.uk/a.html
It seems to have a problem because I'm removing the 'box' class. If I added other classes I can remove them, but not the 'box' one.
| SitePoint Sponsor |


This makes no sense:
http://page-test.co.uk/a.html
It seems to have a problem because I'm removing the 'box' class. If I added other classes I can remove them, but not the 'box' one.


I've never seen regex with "whitespace" or "beginning" .. "whitespace" or "end" written like that.Code:function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); }
Maybe try
"beginning" maybe "whitespace" ..... maybe "whitespace" "end"Code:RegExp('^(\\s)?'+cls+'(\\s)?$'));
Bookmarks