首页 >web前端 >js教程 >用javascript实现自定义标签_javascript技巧

用javascript实现自定义标签_javascript技巧

WBOY
WBOY原创
2016-05-16 19:13:331639浏览

//by zdzhuo 



<script> <BR>var d = document; <BR>var mk = new Array( <BR>'<red>','<span style="color:red;">', <BR>'','', <BR>'<big>','<span style="font-size:22pt;">', <BR>'','', <BR>'<zhuo>','<span style="font-style:oblique;">', <BR>'','', <BR>'<next>','<br><br>' <BR>); <BR>function mark() { <BR>var t = new String(d.body.innerHTML); <BR>for(i=0;i<mk.length;i+=2) t = t.replace(new RegExp(mk[i], 'gi'),mk[i+1]); <BR>d.body.innerHTML = t; <BR>} <BR></script>


zdzhuo

zdzhuo

zdzhuo

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn