vara节点
varnode=cc.find("Canvas/bg");//通过访问路径获取节点vara=this.node.getChildByName('name');//通过名称获取子节点node.getComponent(cc.Label). thenodeTypeofstring='abtextnode(文本空格、换行符等)is3*主操作元素节点getstheparentnode//获取子节点firstvarb=document.querySelector('.b');//获取parentnodevara=b.parentNode;console.log(a);//获取
3.Commonattributesofnodesfunctiontest01(){//获取标签节点对象withida.vara=document.getElementById("a");//获取当前节点的父节点varb=a.parentNode;console.log(b);//创建节点.Thenodestructasfollows.TherootnodehangstheTransformTestscript.ThescriptcodeisasfollowsusingUnityEngine ;publicclassTransformTest:MonoBehaviour{Transformm_selfTrans;voidAwake(){//Cacheitsowntr
parentnode.replacechild(newNode,oldNode)cloneNodeDeepclone:cloneTheChildNodeTogethershallowClone:唯一的thefoundnodewillbecloned,thechildnodewillnotclonotclonetclonetClonEthenEthenEthatneeDethatneEdtneEdStoBecOpied:clonenenone(trvara=docucteTextnewnode)(creatextnode。entnode-usage:parentnode.appendchild(childnode)5 .insertBefore()-可以插入到指定子节点之前new
getthehyperlinkaelementnodeabovevara=document.getElementById("aid");//操作节点属性console.log(a.href);a.title="BaiduURL";//通过已知的HTMLDOMa.aa="bb";/Insertnodeappendchild()vara=document.createElement ('i')a.innerText="Insert1"//第一个插入语法:parenttag.appenChild(childtag)document. body.appendChild(a)//
//4.jqobject.unwrap();jqobjectdeletionandparentnodedeletionuntilbodyendvara=$('span').unwrap().unwrap().unwrap().unwrap();console.log(a,b);Eventobject/*Eventobject:Getanodeobjectwithidiamge1, 并设置其sr属性值。 b)通过标签名:document.getElementsByTagName("tagname")示例:vardivs=document.getElementsByTagN
相关推荐