Как я могу создать ссылку с element.appendChild

SELECT DISTINCT (user_id) 
FROM [user]
WHERE user.user_id In (select user_id from user where ancestry = 'England') 
    And user.user_id In (select user_id from user where ancestry = 'France') 
    And user.user_id In (select user_id from user where ancestry = 'Germany');`
0
задан Leon 26 February 2019 в 14:11
поделиться

3 ответа

const orgInput = document.getElementById('organisation'),
a = document.getElementById('a');

function setA(){
  a.innerText = orgInput.value;
  a.href = orgInput.value;
}
<input type="text" id="organisation">
<input type="button" onclick="setA()" value="create"/>
<a id="a"></a>

0
ответ дан Oscar R 26 February 2019 в 14:11
поделиться

Я мог бы решить таким образом и работает:

orglink = "<a href='" + webSite + "' target='_blank'>" + newOrg + "</a>";

Большое спасибо за вашу помощь, ребята. [115 ]

0
ответ дан Leon 26 February 2019 в 14:11
поделиться

Вы можете использовать что-то вроде этого:

let a = document.createElement('a');
let anchorText = document.createTextNode("Organization name");
a.appendChild(anchorText);
a.title = "Open organization webpage";
a.href = "http://example.com";
document.body.appendChild(a);
0
ответ дан xYundy 26 February 2019 в 14:11
поделиться
Другие вопросы по тегам:

Похожие вопросы: