I have an html input that is required and I am setting a pattern on the input dynamically using jQuery, like this:
let theString = 'test'
$('input[name="string"]').attr("pattern", theString)
this works fine, the input is only valid when its value is exactly equal to: test
How can I do the reverse of this? I would like it only to be valid if the value is anything other than: test
if(!(totest.indexOf('test') > -1)){ // means test is not within the string }