.prop('action', 'https://www.theaction.com'); // Is to set
.val = "" // If empty
Then something like how to detect if the action property contain https://?
$('form:contains(''https://') or something? But this is for text not for property as I know.
const form = document.querySelector('form');
I understand this get the value. But how check is contain https:// or not or just have there action=“changeme”?
You can do it with regex:
Thank you by the way is not that easy for me to understand.
Please take a look this?
Is always give back true? just for a-z so how check https then? This case is need to be false not? As not just a-z contains?
You have a typo on the following line:
var input = $("register").attr("action");
You are missing a # in front of register.
The reason you /^[a-z]+/.test returns true is because if you assign “https:” to the “action” attribute, the regex matches the “https” because your regex is checking if one or more of the first characters are in the character set a-z.