'How to add pattern and title in input
Hi all I have following code:
<form>
<input type="text" id="FormField_6_input" name="CompanyName"/>
<button id="ContinueButton_6">Continue</button>
</form>
<script>
let companyNameField = document.getElementById('FormField_6_input');
companyNameField.setAttribute("pattern", "/[2-9]{1}\d{3}/");
companyNameField.setAttribute("title", "invalid input");
</script>
I want to add pattern and title attributes to my input but it not working please help me to resolve this problem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
