The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> How to get the number of elements with a non-empty class name
post May 25 2019, 03:36 AM
Post #1

Advanced Member

Group: Members
Posts: 216
Joined: 16-November 09
Member No.: 10,346

Sample code:

<!DOCTYPE html>
<html lang="en">

  <title>Get elements number</title>

  <p class="">Hello, world!</p>
  <p class="5">Hello, world!</p>
  <p class="9">Hello, world!</p>
  <p class="">Hello, world!</p>



What I get: 4
What I expect: 2
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 17th September 2019 - 11:15 AM