I have the following code:
var formSubmitHandler = function (link, form) {
//e.preventDefault();
var $form = form;
var val = $form.valid();
var action = $(form).data('action');
var entity = $(form).data('entity');
Do I need the line "var $form = form"? Can I just later on do "var val = form.valid(); ?
It's not my code so I am wondering why the developer added the $ before the form and assigned it?
Update:
Thanks for all your replies. If as has been said it's just to indicate that it's a jQuery variable then could I just remove that line by changing the function parameters to (link, $form) ?