// get document
Document doc = tab.MainDocument;
// find first element
HtmlElement he1 = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
// find second element
HtmlElement he2 = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByName("rad");
// if both elements are exist then replace he1 to he2
if (!he1.IsVoid && !he2.IsVoid) doc.ReplaceElement(he2, h1);
// get document
$doc = $tab->MainDocument;
// find first element
$he1 = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
// find second element
$he2 = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByName("rad");
// if both elements are exist then replace he1 to he2
if (!$he1->IsVoid && !$he2->IsVoid) $doc->ReplaceElement($he2, $h1);