Text Growing & Shrinking in JavaScript

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

  1. innerHTML:- The innerHTML property sets or returns the HTML content (inner HTML) of an element.
  2. 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.
  3. clearInterval():- The clearInterval() method clears a timer set with the setInterval() method.
  4. setAttribute():- The setAttribute() method adds the specified attribute to an element, and gives it the specified value.

JavaScript Code


output

Text Growing & Shrinking in JavaScript video Tutorial


No comments:

For Query and doubts!

Powered by Blogger.