コードに動的に追加された改行
タグがアンカーである最初のタグの後に機能しないという問題に直面しています動的に追加されたすべてのリンクが新しい行に移動する必要があります
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function addAnchorNode(){
var link = document.createElement('a');
link.setAttribute('href', 'http://Google.co.uk');
link.innerHTML = "Hello, Google!";
document.body.appendChild(link);
document.body.appendchild(document.createElement('br')); //Never Works
}
</script>
</head>
<body>
<button onclick="addAnchorNode()">Click me</button>
</body>
</html>