|
|
- function hasClass(el, cls) {
- return el.className && new RegExp("(\\s|^)" + cls + "(\\s|$)").test(el.className);
- }
- function removeClass(ele,cls) {
- if (hasClass(ele,cls)) {
- var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
- ele.className=ele.className.replace(reg,' ');
- }
- }
- function removeId(id) {
- return (elem=document.getElementById(id)).parentNode.removeChild(elem);
- }
|