JSFiddle - React, Tailwind, and code Playground

by Govinda Ghimire

HTML

<label id="label1">
   <input type="checkbox">
   NeedThisText
</label>

JavaScript

var requiredvalue=$('label').text();
  console.log(requiredvalue);
alert(requiredvalue);