牛客4124552号
牛客4124552号
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
牛客4124552号的博客
全部文章
(共3篇)
题解 | #将字符串转换为驼峰格式#
function cssStyle2DomStyle(sName) { const reg = /-\w/g const matchArr = sName.match(reg) matchArr.forEach((item) => { sName = sName.repla...
HTML/CSS/JavaScript
2021-10-11
0
304
题解 | #颜色字符串转换#
function rgb2hex(sRGB) { // 匹配是否符合颜色格式 let erx = /rgb\((\d{0,3},\s*){2}\d{0,3}\)/ if(!erx.test(sRGB)) { return sRGB } // 找出xxx,xxx,xxx ...
HTML/CSS/JavaScript
2021-10-11
1
382
题解 | #替换链接#
function link() { const content = document.querySelector('#jsContainer') const html = content.innerHTML const newHtml = html.replace(/((ht...
HTML/CSS/JavaScript
2021-09-23
0
495