我可以将2个类应用于单个div或span或任何html元素吗?例如:
<a class="c1" class="c2">aa</a>
Run Code Online (Sandbox Code Playgroud)
我试过,在我的情况下,c2没有得到应用.我怎样才能同时申请这两个课程?
我想动态创建一些HTML元素(3个html元素),然后将此html代码作为变量中的字符串返回.我不想将以下函数中的HTML代码写入某个div,但是,我想在var中返回它.
function createMyElements(id1,id2,id3){
//create anchor with id1
//create div with id 2
//create xyz with id3
//now return the html code of above created just now
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?