How do i check <p> element is empty using class? #javascript : How do i check if the element is p is empty using class.
for e.g.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    n=1
    while (n<4) {
     if (checks if p element class(n) is empty){
     //Replaces the p element with variable
    }
     else {
     n++} 

<!-- end snippet -->

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <p id="working" class="machine1"></p>
    <p id="working" class="machine2"></p>
    <p id="working" class="machine3"></p>

<!-- end snippet -->




