我想在单选按钮之间添加一个新行。
我能够将文本添加到我的单选按钮,但“\n”的 createTextNode 确实有效......虽然 '\n' 显示在 HTML 上......但“\n”没有也没有掉线.
$showXLS = new DOMDocument();
$showXLS->formatOutput = true;
$showXLS->preserveWhiteSpace = false;
$sXLSSpan = $showXLS->createElement('Span');
$showXLS->appendChild($sXLSSpan);
$sXLSSpan->setAttribute('id','saveOptions');
$sXLSSpan->setAttribute('style','VISIBILITY');
$sXLSDiv = $showXLS->createElement('Div');
$sXLSSpan->appendChild($sXLSDiv);
$sXLSDiv->setAttribute('id','showingOptions');
$sXLSDiv->setAttribute('align','right');
$sXLSForm = $showXLS->createElement('Form');
$sXLSDiv->appendChild($sXLSForm);
$sXLSForm->setAttribute('id','sXLSForm');
$sXLSForm->setAttribute('action','printTest.php');
$sXLSForm->setAttribute('method','POST');
$sXLSInput1Text = $showXLS->createElement('label','<b>Save Directory</b>');
$sXLSForm->appendChild($sXLSInput1Text);
$sXLSInput1Text->appendChild($showXLS->createTextNode("\n"));
$sXLSInput1 = $showXLS->createElement('input');
$sXLSInput1Text->appendChild($sXLSInput1);
$sXLSInput1->setAttribute('type','radio');
$sXLSInput1->setAttribute('name','save');
$sXLSInput1->setAttribute('value','saveDirectory');
$sXLSInput1->setAttribute('id','saveDirectory');
$sXLSInput2Text = $showXLS->createElement('label','Save Email');
$sXLSForm->appendChild($sXLSInput2Text);
$sXLSInput2Text->appendChild($showXLS->createTextNode("\n"));
////////////// 这里换行
$sXLSInput2 = $showXLS->createElement('input');
$sXLSInput2Text->appendChild($sXLSInput2);
$sXLSInput2->setAttribute('type','radio');
$sXLSInput2->setAttribute('name','save');
$sXLSInput2->setAttribute('value','saveEmail');
$sXLSInput2->setAttribute('onClick','getMore()');