Hello Friends My Name Is Viraj,Today I Will Create Type Writing Effect On Your Web Page.
Here In This Html Tutorial We Will Create Type Writing Effect In Html/Css/Javascript Code.
Here In This Blog We Will Create Type Writing Effect In Html/Css/Javascript Code.
Here Is An Example Related To Topic..............
So Let Begin With Our Coding............
Step 1 :
<!DOCTYPE html>
<html>
<body>
<h1>Typewriter</h1>
<button onclick="typeWriter()">Click me</button>
<p id="demo"></p>
<script>
var i = 0;
var txt = 'I Love You.';
var speed = 50;
function typeWriter() {
if (i < txt.length) {
document.getElementById("demo").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
</script>
</body>
</html>
Output :
HTML stands for Hyper Text Markup
Language. It is the
standard markup language used for creating
web pages and web applications. It forms a
triology of technologies for the World Wide Web with Cascading Style
Sheets
(CSS) and JavaScript. HTML
elements are the building blocks of HTML pages. HTML elements are represented by
using tags, written using angle brackets. For e.g.
<html> </html>, <head></head> and so on. These tags are
used to interpret the content of the page.
Here In This Html Tutorial We Will Create Type Writing Effect In Html/Css/Javascript Code.
Here In This Blog We Will Create Type Writing Effect In Html/Css/Javascript Code.
Here Is An Example Related To Topic..............
So Let Begin With Our Coding............
Step 1 :
<!DOCTYPE html>
<html>
<body>
<h1>Typewriter</h1>
<button onclick="typeWriter()">Click me</button>
<p id="demo"></p>
<script>
var i = 0;
var txt = 'I Love You.';
var speed = 50;
function typeWriter() {
if (i < txt.length) {
document.getElementById("demo").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
</script>
</body>
</html>
Output :
No comments:
Post a Comment