JSFiddle - React, Tailwind, and code Playground
by juErik
HTML
<p class="firstClass">
Ein Test
</p>
CSS
.firstClass{
font-size: 20px;
}
JavaScript
/**
* Figure out if the element has a class or not.
*
* @param {string} className - The class-name we're looking for.
* @return {boolean} - Whether the element has the class we need or not.
*/
_lemon.prototype.hasClass = function( className ) {
var found = false;
this.each( function( el ) {
if ( el.classList.contains( className ) ) {
found = true;
}
} );
return found;
};
let el = querySelectorAll('p');
let tx = el.textContent;
console.log(tx);