JSFiddle - React, Tailwind, and code Playground

by Rohit Azad

HTML

<a href="#" id="singleTextbtn">click to add </a>


<ul id="rohit"></ul>

CSS

#singleTextbtn{
    border:solid 1px red;
    padding:5px 10px;
    float:left;
}

JavaScript

$('#singleTextbtn').on('click', function(){
			singleLineText();
			console.log( count);
			return false;
		});
		var count = 0;
		function singleLineText(){
			count ++;
			var slt =count+ "count+<li><div class='formSection'+count> <label for='singleLineText_'+count>Single Line Text </label><input type='text' value='' name='singleLineText_'+count id='singleLineText_'+count /><div class='actionSec'> <span class='addBtn' title='click here to add more'></span><span class='removeBtn' title='click here to remove'></span></div> </div> </li>";
			$('#rohit').append (slt);
            
		};