jquery add required

JavaScript
$("input").prop('required',true);
Source

Also in JavaScript: