Skip to main content
Skip table of contents


Counts the number of elements having a given selector. Places the result into a new variable.



Defines the name of the variable that will receive the number of elements having a given selector as a Number value.



Defines the name of the tag, id or class to search for.

If selector starts with:

  • #, it targets the id of an element

  • ., it targets the class of an element

Otherwise the selector targets a tag of an element in HTML.


File, String

Defines the content this command will be inspecting.

Let's take a look at the example below. There are total of three elements that includes the class first.

  <div class="document">
    <div class="round">
      <div class="round first">
        <p class="first rectangle"></p>
        <div class="first">

The number of those elements is stored in "count" variable within this example.

<elementCount var="count" selector=".first" value="${file}" />
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.