Joh*_*nC1 0 javascript jquery function
我目前正在使用这样的东西:
function Select(query)
{
return query[0] === '#' ? document.querySelector(query) : document.querySelectorAll(query);
}
Run Code Online (Sandbox Code Playgroud)
我必须像以下一样使用它:
Select('#id').innerHTML = "content", or Select('.class')
Run Code Online (Sandbox Code Playgroud)
有没有办法可以在没有jQuery的情况下使用$('#id)或$('.class')?