oke.
This commit is contained in:
@@ -1,9 +1,38 @@
|
||||
let title = document.getElementById("title");
|
||||
title.innerHTML = "Hello from js-maker";
|
||||
title.addEventListener("click", function (evt) {
|
||||
// exercise01
|
||||
function replaceParagraphHtml(html) {
|
||||
{
|
||||
console.log("clicked");
|
||||
return true;
|
||||
const p3 = document.querySelector("p");
|
||||
{
|
||||
let p = p3;
|
||||
p.innerHTML = html;
|
||||
return p.innerHTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// exercise02
|
||||
function addSourceLink() {
|
||||
{
|
||||
const p8 = document.querySelector("p");
|
||||
{
|
||||
let p = p8;
|
||||
p.insertAdjacentHTML("afterend", "<a href=\"https://forcemipsum.com/\">Source</a>");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// exercise03
|
||||
function paragraphText() {
|
||||
{
|
||||
const p15 = document.querySelector("p");
|
||||
{
|
||||
let p = p15;
|
||||
return p.textContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user