javascript - Append HTML As String With Input validators -


i want append input fields validator type required , message. append html elements string this. can recommend me ?

content += '<td><input class="cars" type="text" name="amount" companyid=' + companyid + '></td>'; 

just add required attribute?

content += '<td><input required class="cars" type="text" name="amount" companyid=' + companyid + '></td>'; 

Comments