Get or Set text of element with .text()


Description: Get the text content for the first matched element or you can set one or more text content for every matched element.


<!doctype html>
    <html lang="en">
      <meta charset="utf-8">
      <title>text demo</title>
      <script src=""></script>
            bitsyCode('div').text("This text content that has been added through BitsyCode"); // SET TEXT
            var divTEXT = bitsyCode('div').text(); // RETRIEVE TEXT


This text content that has been added through BitsyCode
  • Usage

    • How to use:

      Set or Get the text content of an element using .text().

    • USAGE:

      bitsyCode('element').text("your TEXT content here");
  • Options

    • What options are there:

      There are no options for this method.

  • Returns

    • specifying text() with no specified text content, will return the text of the element.