This commit is contained in:
2024-09-20 07:46:16 +02:00
parent 51c4b93077
commit c31f1b9686
2 changed files with 13 additions and 0 deletions

View File

@ -56,6 +56,12 @@
<input type="text" name="textimput" id="themodifierinputtext" value="Alapszöveg!"> <input type="text" name="textimput" id="themodifierinputtext" value="Alapszöveg!">
<p id="modifiedoutput"></p> <p id="modifiedoutput"></p>
</div> </div>
<div>
<h1>MethodChaining</h1>
<input type="button" value="BEGIN THE QUESTIONING!!!" id="MethodChaining">
</div>
<script src="script.js"></script> <script src="script.js"></script>
</body> </body>
</html> </html>

View File

@ -69,11 +69,18 @@ document.addEventListener("DOMContentLoaded", function() {
out.innerHTML += "Replace letter 'a' with 'o': " + text.replaceAll("a", "o") + "<br>"; out.innerHTML += "Replace letter 'a' with 'o': " + text.replaceAll("a", "o") + "<br>";
out.innerHTML += "Fill till 15 with 'o': " + text.padStart(15, "o") + "<br>"; out.innerHTML += "Fill till 15 with 'o': " + text.padStart(15, "o") + "<br>";
out.innerHTML += "Fill till 15 with 'o': " + text.padEnd(15, "o") + "<br>"; out.innerHTML += "Fill till 15 with 'o': " + text.padEnd(15, "o") + "<br>";
out.innerHTML += "Slice: " + text.slice(0, 3) + "<br>";
}else{ }else{
out.innerHTML = ""; out.innerHTML = "";
} }
}; };
document.getElementById("MethodChaining").onclick = function(){
let name = window.prompt("Please enter your gorgeous name!!");
username = username.strim()
}
}); });