Text Growing & Shrinking in JavaScript
15CSL77
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT
Program
Write a JavaScript code that displays text “TEXT-GROWING” with increasing font size in the interval of 100ms in RED COLOR, when the font size reaches 50pt it displays “TEXT-SHRINKING” in BLUE color. Then the font size decreases to 5pt.
Viva Question
- innerHTML:- The innerHTML property sets or returns the HTML content (inner HTML) of an element.
- setInterval():- The setInterval() method calls a function or evaluates an expression at specified intervals (in milliseconds).The setInterval() method will continue calling the function until clearInterval() is called, or the window is closed.
- clearInterval():- The clearInterval() method clears a timer set with the setInterval() method.
- setAttribute():- The setAttribute() method adds the specified attribute to an element, and gives it the specified value.
No comments:
For Query and doubts!